diff options
author | roel kluin <roel.kluin@gmail.com> | 2009-09-09 05:02:24 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-09-24 15:31:38 +1000 |
commit | 0f3372741f2de8dc85a60be737b519a47b395b85 (patch) | |
tree | de1232bba74a72ceeece8967a257e4608eca5ce5 /arch/powerpc/kernel/vio.c | |
parent | 254be490f257fc3f76ca5f869ac8d107b3827025 (diff) | |
download | kernel_goldelico_gta04-0f3372741f2de8dc85a60be737b519a47b395b85.zip kernel_goldelico_gta04-0f3372741f2de8dc85a60be737b519a47b395b85.tar.gz kernel_goldelico_gta04-0f3372741f2de8dc85a60be737b519a47b395b85.tar.bz2 |
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>
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r-- | arch/powerpc/kernel/vio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index bc7b41e..1b4f674 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c @@ -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); |