public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yangtao Li <tiny.windzz@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yangtao Li <tiny.windzz@gmail.com>
Subject: [PATCH] Input: sparcspkr add of_node_put()
Date: Wed, 21 Nov 2018 08:28:06 -0500	[thread overview]
Message-ID: <20181121132806.22521-1-tiny.windzz@gmail.com> (raw)

of_find_node_by_path() acquires a reference to the node
returned by it and that reference needs to be dropped by its caller.
bl_idle_init() doesn't do that, so fix it.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/input/misc/sparcspkr.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index 4a5afc7fe96e..dc121fbbd3e1 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -205,11 +205,11 @@ static int bbc_beep_probe(struct platform_device *op)
 	info = &state->u.bbc;
 	info->clock_freq = of_getintprop_default(dp, "clock-frequency", 0);
 	if (!info->clock_freq)
-		goto out_free;
+		goto out_put_node;
 
 	info->regs = of_ioremap(&op->resource[0], 0, 6, "bbc beep");
 	if (!info->regs)
-		goto out_free;
+		goto out_put_node;
 
 	platform_set_drvdata(op, state);
 
@@ -217,11 +217,14 @@ static int bbc_beep_probe(struct platform_device *op)
 	if (err)
 		goto out_clear_drvdata;
 
+	of_node_put(dp);
+
 	return 0;
 
 out_clear_drvdata:
 	of_iounmap(&op->resource[0], info->regs, 6);
-
+out_put_node:
+	of_node_put(dp);
 out_free:
 	kfree(state);
 out_err:
-- 
2.17.0


             reply	other threads:[~2018-11-21 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 13:28 Yangtao Li [this message]
2018-12-09  5:23 ` [PATCH] Input: sparcspkr add of_node_put() Frank Lee

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=20181121132806.22521-1-tiny.windzz@gmail.com \
    --to=tiny.windzz@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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