Add check for the return value of iommu_pseries_alloc_group()
to prevent a potential null pointer dereference.
Signed-off-by: Haoxiang Li <redacted>
---
arch/powerpc/platforms/pseries/iommu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 3e1f915fe4f6..3b49a0f76df9 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -1875,6 +1875,9 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
pci = PCI_DN(pdn);
if (!pci->table_group) {
pci->table_group = iommu_pseries_alloc_group(pci->phb->node);
+ if (!pci->table_group)
+ return;
+
tbl = pci->table_group->tables[0];
iommu_table_setparms_common(tbl, pci->phb->bus->number,--
2.25.1