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: <f6e2a491-d701-d05c-eb3b-2f8f5c080a16@collabora.com>
Date:   Thu, 10 Mar 2022 17:06:54 +0100
From:   AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
To:     Miaoqian Lin <linmq006@...il.com>,
        Sean Wang <sean.wang@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Hongzhou Yang <hongzhou.yang@...iatek.com>,
        linux-mediatek@...ts.infradead.org, linux-gpio@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pinctrl: mediatek: Fix missing of_node_put() in
 mtk_pctrl_init

Il 08/03/22 08:11, Miaoqian Lin ha scritto:
> The device_node pointer is returned by of_parse_phandle()  with refcount
> incremented. We should use of_node_put() on it when done.
> 
> Fixes: a6df410d420a ("pinctrl: mediatek: Add Pinctrl/GPIO driver for mt8135.")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>

Thanks!

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>

> ---
>   drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index 5f7c421ab6e7..334cb85855a9 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> @@ -1038,6 +1038,7 @@ int mtk_pctrl_init(struct platform_device *pdev,
>   	node = of_parse_phandle(np, "mediatek,pctl-regmap", 0);
>   	if (node) {
>   		pctl->regmap1 = syscon_node_to_regmap(node);
> +		of_node_put(node);
>   		if (IS_ERR(pctl->regmap1))
>   			return PTR_ERR(pctl->regmap1);
>   	} else if (regmap) {
> @@ -1051,6 +1052,7 @@ int mtk_pctrl_init(struct platform_device *pdev,
>   	node = of_parse_phandle(np, "mediatek,pctl-regmap", 1);
>   	if (node) {
>   		pctl->regmap2 = syscon_node_to_regmap(node);
> +		of_node_put(node);
>   		if (IS_ERR(pctl->regmap2))
>   			return PTR_ERR(pctl->regmap2);
>   	}
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ