mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 05:48:40 +00:00
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:
parent
254be490f2
commit
0f3372741f
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue