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] [day] [month] [year] [list]
Message-ID: <e876afcd-b3ca-a2e4-a9da-65ad11515cd5@huawei.com>
Date:   Mon, 5 Dec 2022 11:42:10 +0800
From:   Yuan Can <yuancan@...wei.com>
To:     <nbd@....name>, <john@...ozen.org>, <sean.wang@...iatek.com>,
        <Mark-MC.Lee@...iatek.com>, <lorenzo@...nel.org>,
        <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
        <pabeni@...hat.com>, <matthias.bgg@...il.com>,
        <sujuan.chen@...iatek.com>, <leon@...nel.org>,
        <netdev@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH] net: ethernet: mtk_wed: Fix missing of_node_put() in
 mtk_wed_wo_hardware_init()

Please ignore this mail, sorry about the noise.

在 2022/12/5 9:58, Yuan Can 写道:
> The np needs to be released through of_node_put() in the error handling
> path of mtk_wed_wo_hardware_init().
>
> Fixes: 799684448e3e ("net: ethernet: mtk_wed: introduce wed wo support")
> Signed-off-by: Yuan Can <yuancan@...wei.com>
> ---
>   drivers/net/ethernet/mediatek/mtk_wed_wo.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_wed_wo.c b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
> index 4754b6db009e..fcc4b3206d2d 100644
> --- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c
> +++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
> @@ -407,8 +407,10 @@ mtk_wed_wo_hardware_init(struct mtk_wed_wo *wo)
>   		return -ENODEV;
>   
>   	wo->mmio.regs = syscon_regmap_lookup_by_phandle(np, NULL);
> -	if (IS_ERR_OR_NULL(wo->mmio.regs))
> -		return PTR_ERR(wo->mmio.regs);
> +	if (IS_ERR(wo->mmio.regs)) {
> +		ret = PTR_ERR(wo->mmio.regs);
> +		goto error_put;
> +	}
>   
>   	wo->mmio.irq = irq_of_parse_and_map(np, 0);
>   	wo->mmio.irq_mask = MTK_WED_WO_ALL_INT_MASK;
> @@ -456,7 +458,8 @@ mtk_wed_wo_hardware_init(struct mtk_wed_wo *wo)
>   
>   error:
>   	devm_free_irq(wo->hw->dev, wo->mmio.irq, wo);
> -
> +error_put:
> +	of_node_put(np);
>   	return ret;
>   }
>   

-- 
Best regards,
Yuan Can

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ