Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

roel kluin and committed by
Benjamin Herrenschmidt
0f337274 254be490

+2
+2
arch/powerpc/kernel/vio.c
··· 1054 1054 return NULL; 1055 1055 1056 1056 tbl = kmalloc(sizeof(*tbl), GFP_KERNEL); 1057 + if (tbl == NULL) 1058 + return NULL; 1057 1059 1058 1060 of_parse_dma_window(dev->dev.archdata.of_node, dma_window, 1059 1061 &tbl->it_index, &offset, &size);