Make the dma_alloc_coherent() function in the LinuxKPI NULL safe with regard
to the "dev" argument. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications MFC after: 1 week
This commit is contained in:
parent
fc5ef1ca4f
commit
a7a3d0d170
@ -127,7 +127,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
|
||||
size_t align;
|
||||
void *mem;
|
||||
|
||||
if (dev->dma_mask)
|
||||
if (dev != NULL && dev->dma_mask)
|
||||
high = *dev->dma_mask;
|
||||
else if (flag & GFP_DMA32)
|
||||
high = BUS_SPACE_MAXADDR_32BIT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user