All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Subject: [PATCH 1/4] ASoC: mc13783: Fix of_node_put() call with uninitialized object
Date: Tue,  7 Oct 2014 18:19:51 +0200	[thread overview]
Message-ID: <1412698794-25536-2-git-send-email-tiwai@suse.de> (raw)
In-Reply-To: <1412698794-25536-1-git-send-email-tiwai@suse.de>

The commit [a28d167fbbef: ASoC: mc13783: Add missing of_node_put]
fixed the leak of OF node, but it calls of_node_put() unconditionally
at error path where the passed pointer might be uninitialized.  It was
caught by a compiler warning:
 sound/soc/codecs/mc13783.c:787:13: warning: 'np' may be used uninitialized in this function [-Wuninitialized]

This patch adds the NULL initialization properly for fixing this.

Fixes: a28d167fbbef ('ASoC: mc13783: Add missing of_node_put')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/mc13783.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index 388f90a597fa..f54fdf6fc20d 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -749,7 +749,7 @@ static int __init mc13783_codec_probe(struct platform_device *pdev)
 {
 	struct mc13783_priv *priv;
 	struct mc13xxx_codec_platform_data *pdata = pdev->dev.platform_data;
-	struct device_node *np;
+	struct device_node *np = NULL;
 	int ret;
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-- 
2.1.2

  reply	other threads:[~2014-10-07 16:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07 16:19 [PATCH 0/4] ASoC trivial fixes Takashi Iwai
2014-10-07 16:19 ` Takashi Iwai [this message]
2014-10-07 17:09   ` [PATCH 1/4] ASoC: mc13783: Fix of_node_put() call with uninitialized object Mark Brown
2014-10-07 17:17     ` Takashi Iwai
2014-10-07 17:23       ` Mark Brown
2014-10-07 17:39         ` Takashi Iwai
2014-10-07 18:04           ` Mark Brown
2014-10-07 18:14             ` Takashi Iwai
2014-10-07 18:54               ` Mark Brown
2014-10-07 18:58                 ` Takashi Iwai
2014-10-07 23:01                   ` Mark Brown
2014-10-08  5:28                     ` Takashi Iwai
2014-10-07 16:19 ` [PATCH 2/4] ASoC: eukrea-tlv320: " Takashi Iwai
2014-10-07 17:18   ` Mark Brown
2014-10-07 17:39     ` Takashi Iwai
2014-10-07 18:56       ` [PATCH v2 " Takashi Iwai
2014-10-07 19:10         ` Mark Brown
2014-10-07 16:19 ` [PATCH 3/4] ASoC: imx-es8328: " Takashi Iwai
2014-10-07 22:52   ` Mark Brown
2014-10-07 16:19 ` [PATCH 4/4] ASoC: imx-es8328: Fix missing return code in imx_es8328_probe() Takashi Iwai
2014-10-07 17:10   ` Mark Brown
2014-10-07 17:11 ` [PATCH 0/4] ASoC trivial fixes Mark Brown
2014-10-07 17:17   ` 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=1412698794-25536-2-git-send-email-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@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 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.