[PATCH] Fix failure return codes from {pci,vio}_alloc_consistent()
Olof Johansson
olof at austin.ibm.com
Wed Apr 7 05:35:56 EST 2004
Hi,
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. Please apply.
Thanks,
-Olof
Olof Johansson Office: 4F005/905
Linux on Power Development IBM Systems Group
Email: olof at austin.ibm.com Phone: 512-838-9858
All opinions are my own and not those of IBM
===== arch/ppc64/kernel/pci_iommu.c 1.5 vs edited =====
--- 1.5/arch/ppc64/kernel/pci_iommu.c Fri Apr 2 13:32:01 2004
+++ edited/arch/ppc64/kernel/pci_iommu.c Tue Apr 6 14:21:31 2004
@@ -83,7 +83,7 @@
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);
===== arch/ppc64/kernel/vio.c 1.14 vs edited =====
--- 1.14/arch/ppc64/kernel/vio.c Fri Apr 2 13:32:01 2004
+++ edited/arch/ppc64/kernel/vio.c Tue Apr 6 14:31:47 2004
@@ -504,8 +504,8 @@
/* 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;
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list