dma-mapping: use dma_get_mask in dma_addressing_limited
authorEric Auger <eric.auger@redhat.com>
Mon, 22 Jul 2019 16:51:49 +0000 (18:51 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 23 Jul 2019 15:43:58 +0000 (17:43 +0200)
commit06532750010e06dd4b6d69983773677df7fc5291
tree1405f8086f5465615024e5447062ead12f80ae7e
parent7b5cf701ea9c395c792e2a7e3b7caf4c68b87721
dma-mapping: use dma_get_mask in dma_addressing_limited

We currently have cases where the dma_addressing_limited() gets
called with dma_mask unset. This causes a NULL pointer dereference.

Use dma_get_mask() accessor to prevent the crash.

Fixes: b866455423e0 ("dma-mapping: add a dma_addressing_limited helper")
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
include/linux/dma-mapping.h