mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Qiheng Lin <linqiheng@huawei.com>
Cc: <michal.simek@xilinx.com>, <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: zynq: Fix refcount leak in zynq_early_slcr_init
Date: Wed, 7 Dec 2022 15:42:06 +0100	[thread overview]
Message-ID: <d1abd7c7-299b-4a2b-456c-2c0e0ef6436a@amd.com> (raw)
In-Reply-To: <20221129140544.41293-1-linqiheng@huawei.com>

Hi,

On 11/29/22 15:05, Qiheng Lin wrote:
> 
> of_find_compatible_node() returns a node pointer with refcount incremented,
> we should use of_node_put() on error path.
> Add missing of_node_put() to avoid refcount leak.
> 
> Fixes: 3329659df030 ("ARM: zynq: Simplify SLCR initialization")
> Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
> ---
>   arch/arm/mach-zynq/slcr.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
> index 37707614885a..9765b3f4c2fc 100644
> --- a/arch/arm/mach-zynq/slcr.c
> +++ b/arch/arm/mach-zynq/slcr.c
> @@ -213,6 +213,7 @@ int __init zynq_early_slcr_init(void)
>          zynq_slcr_regmap = syscon_regmap_lookup_by_compatible("xlnx,zynq-slcr");
>          if (IS_ERR(zynq_slcr_regmap)) {
>                  pr_err("%s: failed to find zynq-slcr\n", __func__);
> +               of_node_put(np);
>                  return -ENODEV;
>          }
> 
> --
> 2.32.0
> 

Applied.

Thanks,
Michal

      reply	other threads:[~2022-12-07 14:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 14:05 Qiheng Lin
2022-12-07 14:42 ` Michal Simek [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=d1abd7c7-299b-4a2b-456c-2c0e0ef6436a@amd.com \
    --to=michal.simek@amd.com \
    --cc=linqiheng@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®