mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rakuram Eswaran <rakuram.e96@gmail.com>
To: vasant.hegde@amd.com
Cc: dan.carpenter@linaro.org, iommu@lists.linux.dev, joro@8bytes.org,
	linux-kernel@vger.kernel.org, lkp@intel.com,
	rakuram.e96@gmail.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: Mon, 12 Jan 2026 22:21:37 +0530	[thread overview]
Message-ID: <20260112165139.7120-1-rakuram.e96@gmail.com> (raw)
In-Reply-To: 561ab88a-ba97-41d8-ad6a-8656a2e2b1d5@amd.com

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. 

Best Regards,
Rakuram

  reply	other threads:[~2026-01-12 16:51 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 [this message]
2026-01-16  6:02       ` Vasant Hegde

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=20260112165139.7120-1-rakuram.e96@gmail.com \
    --to=rakuram.e96@gmail.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=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@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®