Commit 807c274
s390/pci: Fix dev.dma_range_map missing sentinel element
The fixed commit sets up dev.dma_range_map but missed that this is
supposed to be an array of struct bus_dma_region with a sentinel element
with the size field set to 0 at the end. This would lead to overruns in
e.g. dma_range_map_min(). It could also result in wrong translations
instead of DMA_MAPPING_ERROR in translate_phys_to_dma() if the paddr
were to not fit in the aperture. Fix this by using the
dma_direct_set_offset() helper which creates a sentinel for us.
Fixes: d236843 ("s390/pci: store DMA offset in bus_dma_region")
Reviewed-by: Matthew Rosato <[email protected]>
Signed-off-by: Niklas Schnelle <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vasily Gorbik <[email protected]>1 parent af6bfcd commit 807c274
1 file changed
+11
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
292 | 293 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 294 | + | |
299 | 295 | | |
300 | | - | |
301 | | - | |
| 296 | + | |
| 297 | + | |
302 | 298 | | |
303 | | - | |
304 | | - | |
| 299 | + | |
| 300 | + | |
305 | 301 | | |
306 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
307 | 305 | | |
308 | 306 | | |
309 | 307 | | |
| |||
0 commit comments