x86/amd_gart: return error code from gart_map_sg()
authorMartin Oliveira <martin.oliveira@eideticom.com>
Thu, 29 Jul 2021 20:15:36 +0000 (14:15 -0600)
committerChristoph Hellwig <hch@lst.de>
Mon, 9 Aug 2021 15:13:06 +0000 (17:13 +0200)
commitfcacc8a614391d3bf009319509c846fef47d9352
tree01171ea3a6a1cde7d4c892883f4ba73311227768
parent2c647ebe17140f1f5de09d4e30817b1b00a3b588
x86/amd_gart: return error code from gart_map_sg()

The .map_sg() op now expects an error code instead of zero on failure.

So make __dma_map_cont() return a valid errno (which is then propagated
to gart_map_sg() via dma_map_cont()) and return it in case of failure.

Also, return -EINVAL in case of invalid nents.

Signed-off-by: Martin Oliveira <martin.oliveira@eideticom.com>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Niklas Schnelle <schnelle@linux.ibm.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Christoph Hellwig <hch@lst.de>
arch/x86/kernel/amd_gart_64.c