projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
254be49
)
powerpc: kmalloc failure ignored in vio_build_iommu_table()
author
roel kluin
<roel.kluin@gmail.com>
Wed, 9 Sep 2009 05:02:24 +0000
(
05:02
+0000)
committer
Benjamin Herrenschmidt
<benh@kernel.crashing.org>
Thu, 24 Sep 2009 05:31:38 +0000
(15:31 +1000)
Prevent NULL dereference if kmalloc() fails.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/vio.c
patch
|
blob
|
history
diff --git
a/arch/powerpc/kernel/vio.c
b/arch/powerpc/kernel/vio.c
index bc7b41edbdfce10671e942cc0857fdf9d022ea5e..1b4f674ad7c40632776dd32acaafd558b5767f96 100644
(file)
--- 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);