Commit 75e1802f authored by Andrew Morton's avatar Andrew Morton Committed by James Bottomley

[PATCH] nsc-ircc driver crashes on shutdown

From: Petr Vandrovec <vandrove@vc.cvut.cz>

bk-dma-decleare-coherent-memory patch adds a requirement for
dma_free_coherent that dev cannot be NULL...  But it can (nsc-ircc has no
suitable dev) and as dma_alloc_coherent allows NULL dev, dma_free_coherent
should allow it too IMHO.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 8d5c08a4
......@@ -58,7 +58,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
void dma_free_coherent(struct device *dev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
struct dma_coherent_mem *mem = dev->dma_mem;
struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
int order = get_order(size);
if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment