[ Upstream commit 071be3b0b6575d45be9df9c5b612f5882bfc5e88 ]
The initial state of dma_needs_unmap may be false, but change to true
while mapping the data iterator. Enabling swiotlb is one such case that
can change the result. The nvme driver needs to save the mapped dma
vectors to be unmapped later, so allocate as needed during iteration
rather than assume it was always allocated at the beginning. This fixes
a NULL dereference from accessing an uninitialized dma_vecs when the
device dma unmapping requirements change mid-iteration.
Fixes:
|
||
|---|---|---|
| .. | ||
| common | ||
| host | ||
| target | ||
| Kconfig | ||
| Makefile | ||