Re: [PATCH 1/2] dma-mapping: Protect dma_addressing_limited against NULL dma_mask

From: Christoph Hellwig
Date: Mon Jul 22 2019 - 11:26:42 EST


> static inline bool dma_addressing_limited(struct device *dev)
> {
> - return min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
> - dma_get_required_mask(dev);
> + return WARN_ON_ONCE(!dev->dma_mask) ? false :
> + min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
> + dma_get_required_mask(dev);

This should really use a separate if statement, but I can fix that
up when applying it.