summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv/pci-ioda.c
diff options
context:
space:
mode:
authorAlexey Kardashevskiy2017-03-27 10:27:37 +0200
committerMichael Ellerman2017-04-28 13:26:53 +0200
commit82eae1afbbdcaf2d716f88025736dc2d6f7afbf0 (patch)
tree935021c4c48b7d7a3d25223ecc62119b6846ad1d /arch/powerpc/platforms/powernv/pci-ioda.c
parentpowerpc: Add arch/powerpc/tools directory (diff)
downloadkernel-qcow2-linux-82eae1afbbdcaf2d716f88025736dc2d6f7afbf0.tar.gz
kernel-qcow2-linux-82eae1afbbdcaf2d716f88025736dc2d6f7afbf0.tar.xz
kernel-qcow2-linux-82eae1afbbdcaf2d716f88025736dc2d6f7afbf0.zip
powerpc/powernv: Check kzalloc() return value in pnv_pci_table_alloc
pnv_pci_table_alloc() ignores possible failure from kzalloc_node(), this adds a check. There are 2 callers of pnv_pci_table_alloc(), one already checks for tbl!=NULL, this adds WARN_ON() to the other path which only happens during boot time in IODA1 and not expected to fail. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/pci-ioda.c')
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 93ce3f9d2758..bc5466d447e7 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -2151,6 +2151,9 @@ static void pnv_pci_ioda1_setup_dma_pe(struct pnv_phb *phb,
found:
tbl = pnv_pci_table_alloc(phb->hose->node);
+ if (WARN_ON(!tbl))
+ return;
+
iommu_register_group(&pe->table_group, phb->hose->global_number,
pe->pe_number);
pnv_pci_link_table_and_group(phb->hose->node, 0, tbl, &pe->table_group);