From: Vasant Hegde <vasant.hegde@amd.com>
To: Rakuram Eswaran <rakuram.e96@gmail.com>
Cc: dan.carpenter@linaro.org, iommu@lists.linux.dev, joro@8bytes.org,
linux-kernel@vger.kernel.org, lkp@intel.com,
robin.murphy@arm.com, suravee.suthikulpanit@amd.com,
will@kernel.org
Subject: Re: [PATCH] iommu: amd: Fix uninitialized dev_data on probe failure
Date: Fri, 16 Jan 2026 11:32:09 +0530 [thread overview]
Message-ID: <e4d13f5d-e4ea-492e-8209-59c3b6a0425e@amd.com> (raw)
In-Reply-To: <20260112165139.7120-1-rakuram.e96@gmail.com>
Hi Rakuram,
On 1/12/2026 10:21 PM, Rakuram Eswaran wrote:
> Hi Vasant,
>
> On Mon, 12 Jan 2026 at 10:42, Vasant Hegde <vasant.hegde@amd.com> wrote:
>>
>> On 1/10/2026 3:39 PM, Jörg Rödel wrote:
>>> On Sun, Dec 21, 2025 at 11:04:16PM +0530, Rakuram Eswaran wrote:
>>>> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
>>>> index 5d45795c367a..075125f0f52b 100644
>>>> --- a/drivers/iommu/amd/iommu.c
>>>> +++ b/drivers/iommu/amd/iommu.c
>>>> @@ -2426,7 +2426,7 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
>>>> dev_err(dev, "Failed to initialize - trying to proceed anyway\n");
>>>> iommu_dev = ERR_PTR(ret);
>>>> iommu_ignore_device(iommu, dev);
>>>> - goto out_err;
>>>> + return iommu_dev;
>>>> }
>>>
>>> This is not the right fix. It makes the function omit further initialization
>>> steps which are needed event when iommu_init_device() fails (which it only does
>>> on out-of-memory).
>>>
>>> The right fix is to initialize dev_data to NULL and check for that value before
>>> dereferencing it further down to keep the current logic.
>>
>> Ack. I think this function needs rewrite. PCIe device capability
>> check/enablement is scattered between this one and iommu_init_device(). I will
>> fix it as part of other PASID related fixes/cleanups.
>>
>> I think for now below fix is good enough.
>>
>> @Rakuram, @Joerg, let me know if you want me to send proper patch?
>>
>
> Ok.
Done. Thanks.
-Vasant
prev parent reply other threads:[~2026-01-16 6:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-21 17:34 Rakuram Eswaran
2026-01-10 10:09 ` Jörg Rödel
2026-01-12 5:12 ` Vasant Hegde
2026-01-12 16:51 ` Rakuram Eswaran
2026-01-16 6:02 ` Vasant Hegde [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=e4d13f5d-e4ea-492e-8209-59c3b6a0425e@amd.com \
--to=vasant.hegde@amd.com \
--cc=dan.carpenter@linaro.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=rakuram.e96@gmail.com \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=will@kernel.org \
/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®