All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Johannes Berg <johannes@sipsolutions.net>,
	Robert Jarzmik <robert.jarzmik@free.fr>
Subject: [PATCH 1/3] ALSA: ac97: Fix of-node refcount unbalance
Date: Tue, 19 Feb 2019 16:31:22 +0100	[thread overview]
Message-ID: <20190219153124.12595-2-tiwai@suse.de> (raw)
In-Reply-To: <20190219153124.12595-1-tiwai@suse.de>

ac97_of_get_child_device() take the refcount of the node explicitly
via of_node_get(), but this leads to an unbalance.  The
for_each_child_of_node() loop itself takes the refcount for each
iteration node, hence you don't need to take the extra refcount
again.

Fixes: 2225a3e6af78 ("ALSA: ac97: add codecs devicetree binding")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---

Only compile-tested.  Please review carefully.  Thanks!

 sound/ac97/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c
index 9f0c480489ef..9cbf6927abe9 100644
--- a/sound/ac97/bus.c
+++ b/sound/ac97/bus.c
@@ -84,7 +84,7 @@ ac97_of_get_child_device(struct ac97_controller *ac97_ctrl, int idx,
 		if ((idx != of_property_read_u32(node, "reg", &reg)) ||
 		    !of_device_is_compatible(node, compat))
 			continue;
-		return of_node_get(node);
+		return node;
 	}
 
 	return NULL;
-- 
2.16.4

  reply	other threads:[~2019-02-19 15:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19 15:31 [PATCH 0/3] ALSA: Fix of-node refcount unbalance Takashi Iwai
2019-02-19 15:31 ` Takashi Iwai [this message]
2019-02-19 21:08   ` [PATCH 1/3] ALSA: ac97: " Robert Jarzmik
2019-02-19 15:31 ` [PATCH 2/3] ALSA: aoa: " Takashi Iwai
2019-02-19 15:50   ` Johannes Berg
2019-02-19 15:57     ` Takashi Iwai
2019-02-19 15:31 ` [PATCH 3/3] ALSA: ppc: " Takashi Iwai

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=20190219153124.12595-2-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=johannes@sipsolutions.net \
    --cc=robert.jarzmik@free.fr \
    /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.