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: Re: [PATCH 1/4] ASoC: mc13783: Fix of_node_put() call with uninitialized object
Date: Tue, 07 Oct 2014 19:17:08 +0200	[thread overview]
Message-ID: <s5hppe3lrzf.wl-tiwai@suse.de> (raw)
In-Reply-To: <20141007170938.GM4609@sirena.org.uk>

At Tue, 7 Oct 2014 18:09:38 +0100,
Mark Brown wrote:
> 
> On Tue, Oct 07, 2014 at 06:19:51PM +0200, Takashi Iwai wrote:
> 
> > -	struct device_node *np;
> > +	struct device_node *np = NULL;
> 
> No, unconditional initialisations like this are worse than the problem
> they're trying to fix.

Which problem they're trying to fix...?

Initializing with NULL for the of_node_put() at error path is a
standard idiom.  An alternative fix would be to add "if (!pdata)"
before of_node_put(np).  But this isn't really intuitive, either (and
even more error-prone, IMO).


Takashi

  reply	other threads:[~2014-10-07 17:17 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 ` [PATCH 1/4] ASoC: mc13783: Fix of_node_put() call with uninitialized object Takashi Iwai
2014-10-07 17:09   ` Mark Brown
2014-10-07 17:17     ` Takashi Iwai [this message]
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=s5hppe3lrzf.wl-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.