Commit 8e1fab9
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: 88523a6 ("block: Add driver for Micron RealSSD pcie flash cards")
Signed-off-by: Thomas Fourier <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent 5a593de commit 8e1fab9
1 file changed
Lines changed: 17 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2040 | 2040 | | |
2041 | 2041 | | |
2042 | 2042 | | |
2043 | | - | |
| 2043 | + | |
| 2044 | + | |
2044 | 2045 | | |
2045 | | - | |
2046 | | - | |
2047 | | - | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
2048 | 2049 | | |
2049 | 2050 | | |
2050 | 2051 | | |
| |||
2056 | 2057 | | |
2057 | 2058 | | |
2058 | 2059 | | |
2059 | | - | |
2060 | | - | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
2061 | 2065 | | |
2062 | | - | |
2063 | 2066 | | |
2064 | | - | |
| 2067 | + | |
2065 | 2068 | | |
2066 | 2069 | | |
2067 | 2070 | | |
| |||
2112 | 2115 | | |
2113 | 2116 | | |
2114 | 2117 | | |
2115 | | - | |
| 2118 | + | |
2116 | 2119 | | |
2117 | 2120 | | |
2118 | 2121 | | |
2119 | 2122 | | |
| 2123 | + | |
| 2124 | + | |
2120 | 2125 | | |
2121 | 2126 | | |
2122 | 2127 | | |
| |||
3315 | 3320 | | |
3316 | 3321 | | |
3317 | 3322 | | |
3318 | | - | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
3319 | 3326 | | |
3320 | 3327 | | |
3321 | 3328 | | |
| |||
0 commit comments