public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.de>,
	Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
	Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
	patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] ASoC: wm0010: set error code on allocation failure
Date: Fri, 09 May 2014 17:30:09 +0000	[thread overview]
Message-ID: <20140509173009.GL26890@mwanda> (raw)
In-Reply-To: <20140509161808.GE25203@opensource.wolfsonmicro.com>

On Fri, May 09, 2014 at 05:18:08PM +0100, Charles Keepax wrote:
> On Fri, May 09, 2014 at 02:55:38PM +0300, Dan Carpenter wrote:
> > We should return -ENOMEM if the kzalloc() fails instead of returning
> > -ENOMEM.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
> > index 71ce315..8dac6c5 100644
> > --- a/sound/soc/codecs/wm0010.c
> > +++ b/sound/soc/codecs/wm0010.c
> > @@ -682,6 +682,7 @@ static int wm0010_boot(struct snd_soc_codec *codec)
> >  		if (!img_swap) {
> >  			dev_err(codec->dev,
> >  				"Failed to allocate image buffer\n");
> > +			ret = -ENOMEM;
> 
> No need to set this here, it is set 12 lines earlier. I agree the
> current code is not the most clear,

Oops.  That was my bad.  The code is actually totally clear, it was just
sloppiness on my part.  Sorry for that.

regards,
dan carpenter


      reply	other threads:[~2014-05-09 17:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 11:55 [patch] ASoC: wm0010: set error code on allocation failure Dan Carpenter
2014-05-09 16:18 ` Charles Keepax
2014-05-09 17:30   ` Dan Carpenter [this message]

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=20140509173009.GL26890@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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