lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <de3a3e1c-6c51-e951-cc7f-9ce2ccb3f283@ti.com>
Date:   Fri, 7 Jan 2022 08:42:16 -0600
From:   Suman Anna <s-anna@...com>
To:     Miaoqian Lin <linmq006@...il.com>
CC:     Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
        <iommu@...ts.linux-foundation.org>, <linux-kernel@...r.kernel.org>,
        "Nagalla, Hari" <hnagalla@...com>
Subject: Re: [PATCH] iommu/omap: Fix missing put_device() call in
 omap_iommu_probe_device

Hi Miaoqian,

On 1/7/22 2:04 AM, Miaoqian Lin wrote:
> The reference taken by 'of_find_device_by_node()' must be released when
> not needed anymore.

Thanks for catching this.

> Add the corresponding 'put_device()' in the error handling paths.

Also, need it in the regular path, not just in error handling path.

> 
> Fixes: ede1c2e7d4dc ("iommu/omap: Store iommu_dev pointer in arch_data")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
>  drivers/iommu/omap-iommu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
> index 91749654fd49..cbc7ca5e890a 100644
> --- a/drivers/iommu/omap-iommu.c
> +++ b/drivers/iommu/omap-iommu.c
> @@ -1684,6 +1684,7 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
>  		oiommu = platform_get_drvdata(pdev);
>  		if (!oiommu) {
>  			of_node_put(np);
> +			put_device(&pdev->dev);

nit, doesn't matter for functionality, but prefer the put_device before
of_node_put().

regards
Suman

>  			kfree(arch_data);
>  			return ERR_PTR(-EINVAL);
>  		}
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ