block: mtip32xx: Fix usage of dma_map_sg()
authorThomas Fourier <fourier.thomas@gmail.com>
Fri, 27 Jun 2025 12:11:19 +0000 (14:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 8 Jul 2025 17:55:38 +0000 (11:55 -0600)
commit8e1fab9cccc7b806b0cffdceabb09b310b83b553
tree5d25a6641ae79407aa452c6a6014ac83f6610e3a
parent5a593def8bb61a6c036069f1c166a6fe62c0a49a
block: mtip32xx: Fix usage of dma_map_sg()

The dma_map_sg() can fail and, in case of failure, returns 0.  If it
fails, mtip_hw_submit_io() returns an error.

The dma_unmap_sg() requires the nents parameter to be the same as the
one passed to dma_map_sg(). This patch saves the nents in
command->scatter_ents.

Fixes: 88523a61558a ("block: Add driver for Micron RealSSD pcie flash cards")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250627121123.203731-2-fourier.thomas@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/mtip32xx/mtip32xx.c