Commit 728be84f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: fix failure return codes from {pci,vio}_alloc_consistent()

From: Olof Johansson <olof@austin.ibm.com>

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.
parent d0ebc08f
......@@ -83,7 +83,7 @@ void *pci_iommu_alloc_consistent(struct pci_dev *hwdev, size_t size,
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);
......
......@@ -504,8 +504,8 @@ void *vio_alloc_consistent(struct vio_dev *dev, size_t size,
/* 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;
......
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