Skip to content

Commit

Permalink
dma-mapping: fix inverted logic in dma_supported
Browse files Browse the repository at this point in the history
The cleanup in commit 356da6d ("dma-mapping: bypass indirect calls
for dma-direct") accidentally inverted the logic in the check for the
presence of a ->dma_supported() callback. Switch this back to the way it
was to prevent a crash on boot.

Fixes: 356da6d ("dma-mapping: bypass indirect calls for dma-direct")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Thierry Reding authored and Christoph Hellwig committed Dec 20, 2018
1 parent 06d4dd2 commit 8b1cce9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/dma/mapping.c
Original file line number Diff line number Diff line change
@@ -406,7 +406,7 @@ int dma_supported(struct device *dev, u64 mask)

if (dma_is_direct(ops))
return dma_direct_supported(dev, mask);
if (ops->dma_supported)
if (!ops->dma_supported)
return 1;
return ops->dma_supported(dev, mask);
}

0 comments on commit 8b1cce9

Please sign in to comment.