From: Gaurav Batra <gbatra@linux.ibm.com>
To: Haoxiang Li <haoxiang_li2024@163.com>,
maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
chleroy@kernel.org, kees@kernel.org
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/pseries/iommu: Add check for iommu_pseries_alloc_group()
Date: Mon, 22 Jun 2026 11:50:45 -0500 [thread overview]
Message-ID: <d7334f31-f4b9-49db-a8f6-4c989b9fbdbf@linux.ibm.com> (raw)
In-Reply-To: <20260622163818.1273990-1-haoxiang_li2024@163.com>
Hello Haoxiang,
Please add this check for pci_dma_bus_setup_pSeriesLP() as well.
Thanks,
Gaurav
On 6/22/26 11:38 AM, Haoxiang Li wrote:
> Add check for the return value of iommu_pseries_alloc_group()
> to prevent a potential null pointer dereference.
>
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> ---
> 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,
prev parent reply other threads:[~2026-06-22 16:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 16:38 Haoxiang Li
2026-06-22 16:50 ` Gaurav Batra [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d7334f31-f4b9-49db-a8f6-4c989b9fbdbf@linux.ibm.com \
--to=gbatra@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=haoxiang_li2024@163.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®