From: Olof Johansson A bug snuck in during the rewrite of ppc64 IOMMU code. When a {pci,vio}_alloc_consistent() call fails, DMA_ERROR_CODE is returned instead of NULL. --- 25-akpm/arch/ppc64/kernel/pci_iommu.c | 2 +- 25-akpm/arch/ppc64/kernel/vio.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff -puN arch/ppc64/kernel/pci_iommu.c~ppc64-alloc_consistent-retval-fixes arch/ppc64/kernel/pci_iommu.c --- 25/arch/ppc64/kernel/pci_iommu.c~ppc64-alloc_consistent-retval-fixes Tue Apr 6 15:53:25 2004 +++ 25-akpm/arch/ppc64/kernel/pci_iommu.c Tue Apr 6 15:53:25 2004 @@ -83,7 +83,7 @@ void *pci_iommu_alloc_consistent(struct if (order >= IOMAP_MAX_ORDER) { printk("PCI_DMA: pci_alloc_consistent size too large: 0x%lx\n", size); - return (void *)DMA_ERROR_CODE; + return NULL; } tbl = devnode_table(hwdev); diff -puN arch/ppc64/kernel/vio.c~ppc64-alloc_consistent-retval-fixes arch/ppc64/kernel/vio.c --- 25/arch/ppc64/kernel/vio.c~ppc64-alloc_consistent-retval-fixes Tue Apr 6 15:53:25 2004 +++ 25-akpm/arch/ppc64/kernel/vio.c Tue Apr 6 15:53:25 2004 @@ -504,8 +504,8 @@ void *vio_alloc_consistent(struct vio_de /* Client asked for way to much space. This is checked later anyway */ /* It is easier to debug here for the drivers than in the tce tables.*/ if(order >= IOMAP_MAX_ORDER) { - printk("VIO_DMA: vio_alloc_consistent size to large: 0x%lx \n", size); - return (void *)DMA_ERROR_CODE; + printk("VIO_DMA: vio_alloc_consistent size too large: 0x%lx \n", size); + return NULL; } tbl = dev->iommu_table; _