soc.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable-commits@vger.kernel.org, windhl@126.com
Cc: Viresh Kumar <vireshk@kernel.org>,
	Shiraz Hashim <shiraz.linux.kernel@gmail.com>,
	soc@kernel.org, Russell King <linux@armlinux.org.uk>
Subject: Patch "arm: mach-spear: Add missing of_node_put() in time.c" has been added to the 4.9-stable tree
Date: Tue, 20 Sep 2022 17:47:21 -0400	[thread overview]
Message-ID: <20220920214722.208469-1-sashal@kernel.org> (raw)

This is a note to let you know that I've just added the patch titled

    arm: mach-spear: Add missing of_node_put() in time.c

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm-mach-spear-add-missing-of_node_put-in-time.c.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.



commit 36321bb4ae4d9831fed71238b076d1eb4a8bba8e
Author: Liang He <windhl@126.com>
Date:   Thu Jun 16 17:30:27 2022 +0800

    arm: mach-spear: Add missing of_node_put() in time.c
    
    [ Upstream commit 2c629dd2d14fd7f64a553f809eda6d0b3a4f615a ]
    
    In spear_setup_of_timer(), of_find_matching_node() will return a
    node pointer with refcount incrementd. We should use of_node_put()
    in each fail path or when it is not used anymore.
    
    Signed-off-by: Liang He <windhl@126.com>
    Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
    Link: https://lore.kernel.org/r/20220616093027.3984903-1-windhl@126.com'
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c
index aaaa6781b9fe..57b77c7effa9 100644
--- a/arch/arm/mach-spear/time.c
+++ b/arch/arm/mach-spear/time.c
@@ -223,13 +223,13 @@ void __init spear_setup_of_timer(void)
 	irq = irq_of_parse_and_map(np, 0);
 	if (!irq) {
 		pr_err("%s: No irq passed for timer via DT\n", __func__);
-		return;
+		goto err_put_np;
 	}
 
 	gpt_base = of_iomap(np, 0);
 	if (!gpt_base) {
 		pr_err("%s: of iomap failed\n", __func__);
-		return;
+		goto err_put_np;
 	}
 
 	gpt_clk = clk_get_sys("gpt0", NULL);
@@ -244,6 +244,8 @@ void __init spear_setup_of_timer(void)
 		goto err_prepare_enable_clk;
 	}
 
+	of_node_put(np);
+
 	spear_clockevent_init(irq);
 	spear_clocksource_init();
 
@@ -253,4 +255,6 @@ void __init spear_setup_of_timer(void)
 	clk_put(gpt_clk);
 err_iomap:
 	iounmap(gpt_base);
+err_put_np:
+	of_node_put(np);
 }

                 reply	other threads:[~2022-09-20 21:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220920214722.208469-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=shiraz.linux.kernel@gmail.com \
    --cc=soc@kernel.org \
    --cc=stable-commits@vger.kernel.org \
    --cc=vireshk@kernel.org \
    --cc=windhl@126.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;
as well as URLs for NNTP newsgroup(s).