dect
/
linux-2.6
Archived
13
0
Fork 0

powerpc: kmalloc failure ignored in vio_build_iommu_table()

Prevent NULL dereference if kmalloc() fails.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
roel kluin 2009-09-09 05:02:24 +00:00 committed by Benjamin Herrenschmidt
parent 254be490f2
commit 0f3372741f
1 changed files with 2 additions and 0 deletions

View File

@ -1054,6 +1054,8 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
return NULL;
tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);
if (tbl == NULL)
return NULL;
of_parse_dma_window(dev->dev.archdata.of_node, dma_window,
&tbl->it_index, &offset, &size);