From: Mukesh Ojha <mojha@codeaurora.org>
To: Huang Zijiang <huang.zijiang@zte.com.cn>, dinguyen@kernel.org
Cc: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, wang.yi59@zte.com.cn
Subject: Re: [PATCH] ARM: socfpga: Fix object reference leaks in socfpga_setup_ocram_self_refresh
Date: Wed, 27 Mar 2019 12:47:26 +0530 [thread overview]
Message-ID: <36c310f4-e22d-42bb-4d8d-c1e41306ede2@codeaurora.org> (raw)
In-Reply-To: <1553644422-42950-1-git-send-email-huang.zijiang@zte.com.cn>
On 3/27/2019 5:23 AM, Huang Zijiang wrote:
> The of_find_device_by_node() takes a reference to the underlying device
> structure, we should release that reference.
>
> Signed-off-by: Huang Zijiang <huang.zijiang@zte.com.cn>
> ---
> arch/arm/mach-socfpga/pm.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-socfpga/pm.c b/arch/arm/mach-socfpga/pm.c
> index d486678..8d7ca14 100644
> --- a/arch/arm/mach-socfpga/pm.c
> +++ b/arch/arm/mach-socfpga/pm.c
> @@ -53,7 +53,7 @@ static int socfpga_setup_ocram_self_refresh(void)
> if (!pdev) {
> pr_warn("%s: failed to find ocram device!\n", __func__);
> ret = -ENODEV;
> - goto put_node;
> + goto fail;
> }
>
> ocram_pool = gen_pool_get(&pdev->dev, NULL);
> @@ -94,6 +94,9 @@ static int socfpga_setup_ocram_self_refresh(void)
>
> put_node:
> of_node_put(np);
> + put_device(&np->dev);
> +fail:
> + of_node_put(np);
of_node_put is called twice for put_node label.
Thanks,
Mukesh
>
> return ret;
> }
prev parent reply other threads:[~2019-03-27 7:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-26 23:53 Huang Zijiang
2019-03-27 7:17 ` Mukesh Ojha [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=36c310f4-e22d-42bb-4d8d-c1e41306ede2@codeaurora.org \
--to=mojha@codeaurora.org \
--cc=dinguyen@kernel.org \
--cc=huang.zijiang@zte.com.cn \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=wang.yi59@zte.com.cn \
/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
Powered by JetHome