All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Qian <ming.qian@nxp.com>
To: Lijun Fang <fanglijun3@huawei.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Shijie Qin <shijie.qin@nxp.com>, Eagle Zhou <eagle.zhou@nxp.com>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>,
	"xuqiang36@huawei.com" <xuqiang36@huawei.com>
Subject: RE: [PATCH] media: amphion: Add missing of_node_put() in vpu_core_parse_dt
Date: Mon, 14 Mar 2022 07:22:30 +0000	[thread overview]
Message-ID: <AM6PR04MB63411E778D7D0F0495A415B0E70F9@AM6PR04MB6341.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20220314060952.66762-1-fanglijun3@huawei.com>

> From: Lijun Fang [mailto:fanglijun3@huawei.com]
> Sent: Monday, March 14, 2022 2:10 PM
> To: linux-media@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: Ming Qian <ming.qian@nxp.com>; Shijie Qin <shijie.qin@nxp.com>; Eagle
> Zhou <eagle.zhou@nxp.com>; mchehab@kernel.org; hverkuil-cisco@xs4all.nl;
> xuqiang36@huawei.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@huawei.com>

Reviewed-by: Ming Qian <ming.qian@nxp.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


      reply	other threads:[~2022-03-14  7:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14  6:09 [PATCH] media: amphion: Add missing of_node_put() in vpu_core_parse_dt Lijun Fang
2022-03-14  7:22 ` Ming Qian [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR04MB63411E778D7D0F0495A415B0E70F9@AM6PR04MB6341.eurprd04.prod.outlook.com \
    --to=ming.qian@nxp.com \
    --cc=eagle.zhou@nxp.com \
    --cc=fanglijun3@huawei.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=shijie.qin@nxp.com \
    --cc=xuqiang36@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.