[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ube32gksp3noozdql3bm7stqsmjlijlvldsidhy6js4ub5fhdv@zmhsfnwgjltw>
Date: Sat, 10 Jan 2026 11:09:01 +0100
From: Jörg Rödel <joro@...tes.org>
To: Rakuram Eswaran <rakuram.e96@...il.com>
Cc: will@...nel.org, suravee.suthikulpanit@....com, robin.murphy@....com,
dan.carpenter@...aro.org, iommu@...ts.linux.dev, lkp@...el.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iommu: amd: Fix uninitialized dev_data on probe failure
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.
-Joerg
Powered by blists - more mailing lists