[PATCH] 2.6.8.1-mm3: nsc-ircc driver crashes on shutdown

From: Petr Vandrovec
Date: Sun Aug 22 2004 - 10:03:57 EST


Hi,
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.
Thanks,
Petr Vandrovec


diff -urN linux/arch/i386/kernel/pci-dma.c linux/arch/i386/kernel/pci-dma.c
--- linux/arch/i386/kernel/pci-dma.c 2004-08-21 00:51:49.000000000 +0200
+++ linux/arch/i386/kernel/pci-dma.c 2004-08-21 13:51:03.000000000 +0200
@@ -58,7 +58,7 @@
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))) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/