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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 14 Mar 2022 07:22:30 +0000
From:   Ming Qian <ming.qian@....com>
To:     Lijun Fang <fanglijun3@...wei.com>,
        "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     Shijie Qin <shijie.qin@....com>, Eagle Zhou <eagle.zhou@....com>,
        "mchehab@...nel.org" <mchehab@...nel.org>,
        "hverkuil-cisco@...all.nl" <hverkuil-cisco@...all.nl>,
        "xuqiang36@...wei.com" <xuqiang36@...wei.com>
Subject: RE: [PATCH] media: amphion: Add missing of_node_put() in
 vpu_core_parse_dt

> From: Lijun Fang [mailto:fanglijun3@...wei.com]
> Sent: Monday, March 14, 2022 2:10 PM
> To: linux-media@...r.kernel.org; linux-kernel@...r.kernel.org
> Cc: Ming Qian <ming.qian@....com>; Shijie Qin <shijie.qin@....com>; Eagle
> Zhou <eagle.zhou@....com>; mchehab@...nel.org; hverkuil-cisco@...all.nl;
> xuqiang36@...wei.com
> Subject: [PATCH] media: amphion: Add missing of_node_put() in
> vpu_core_parse_dt
> 
> The device_node pointer is returned by of_parse_phandle()  with refcount
> incremented. We should use of_node_put() on it when done.
> 
> Fixes: 9f599f351e86 ("media: amphion: add vpu core driver")
> Signed-off-by: Lijun Fang <fanglijun3@...wei.com>

Reviewed-by: Ming Qian <ming.qian@....com>

> ---
>  drivers/media/platform/amphion/vpu_core.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/media/platform/amphion/vpu_core.c
> b/drivers/media/platform/amphion/vpu_core.c
> index 016554387f3f..74edc4abbdaa 100644
> --- a/drivers/media/platform/amphion/vpu_core.c
> +++ b/drivers/media/platform/amphion/vpu_core.c
> @@ -529,10 +529,12 @@ static int vpu_core_parse_dt(struct vpu_core *core,
> struct device_node *np)
>  	}
>  	if (of_address_to_resource(node, 0, &res)) {
>  		dev_err(core->dev, "boot-region of_address_to_resource error\n");
> +		of_node_put(node);
>  		return -EINVAL;
>  	}
>  	core->fw.phys = res.start;
>  	core->fw.length = resource_size(&res);
> +	of_node_put(node);
> 
>  	node = of_parse_phandle(np, "memory-region", 1);
>  	if (!node) {
> @@ -541,10 +543,12 @@ static int vpu_core_parse_dt(struct vpu_core *core,
> struct device_node *np)
>  	}
>  	if (of_address_to_resource(node, 0, &res)) {
>  		dev_err(core->dev, "rpc-region of_address_to_resource error\n");
> +		of_node_put(node);
>  		return -EINVAL;
>  	}
>  	core->rpc.phys = res.start;
>  	core->rpc.length = resource_size(&res);
> +	of_node_put(node);
> 
>  	if (core->rpc.length < core->res->rpc_size + core->res->fwlog_size) {
>  		dev_err(core->dev, "the rpc-region <%pad, 0x%x> is not enough\n",
> --
> 2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ