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: <9c46615d-2dfb-837e-48a8-9d952c04a824@xs4all.nl>
Date:   Fri, 18 Nov 2022 15:43:02 +0100
From:   Hans Verkuil <hverkuil-cisco@...all.nl>
To:     wangkailong@...i.cn, mchehab@...nel.org, matthias.bgg@...il.com,
        moudy.ho@...iatek.com, sunke32@...wei.com
Cc:     linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: platform: mtk-mdp3: add missing call to
 of_node_put()

On 11/13/22 12:05, wangkailong@...i.cn wrote:
> Fix the following coccicheck warning:
> 
> drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:892:1-23: WARNING:
> Function "for_each_child_of_node" should have of_node_put() before
> return around line 914.
> drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:892:1-23: WARNING:
> Function "for_each_child_of_node" should have of_node_put() before
> return around line 920.
> drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:951:1-23: WARNING:
> Function "for_each_child_of_node" should have of_node_put() before
> return around line 993.
> 
> Signed-off-by: KaiLong Wang <wangkailong@...i.cn>
> ---
>  drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
> index d3eaf8884412..4162fc732f38 100644
> --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
> +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
> @@ -908,6 +908,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
>  		alias_id = mdp_comp_alias_id[type];
>  		id = mdp_comp_get_id(type, alias_id);
>  		if (id < 0) {
> +			of_node_put(node);
>  			dev_err(dev,
>  				"Fail to get sub comp. id: type %d alias %d\n",
>  				type, alias_id);
> @@ -916,8 +917,10 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
>  		mdp_comp_alias_id[type]++;
>  
>  		comp = mdp_comp_create(mdp, node, id);
> -		if (IS_ERR(comp))
> +		if (IS_ERR(comp)) {
> +			of_node_put(node);
>  			return PTR_ERR(comp);
> +		}
>  	}
>  
>  	return 0;
> @@ -988,6 +991,7 @@ int mdp_comp_config(struct mdp_dev *mdp)
>  
>  		pdev = of_find_device_by_node(node);
>  		if (!pdev) {
> +			of_node_put(node);
>  			dev_warn(dev, "can't find platform device of node:%s\n",
>  				 node->name);
>  			return -ENODEV;

There is a 'goto err_init_comps;' in this function as well that needs
an of_node_put(node); line.

Can you make a v2?

Regards,

	Hans

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ