* [patch] ASoC: wm0010: set error code on allocation failure
@ 2014-05-09 11:55 Dan Carpenter
2014-05-09 16:18 ` Charles Keepax
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2014-05-09 11:55 UTC (permalink / raw)
To: Liam Girdwood
Cc: Mark Brown, Jaroslav Kysela, Takashi Iwai, Charles Keepax,
Dimitris Papastamos, Wei Yongjun, patches, alsa-devel,
kernel-janitors
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;
goto abort;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch] ASoC: wm0010: set error code on allocation failure
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
0 siblings, 1 reply; 3+ messages in thread
From: Charles Keepax @ 2014-05-09 16:18 UTC (permalink / raw)
To: Dan Carpenter
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Dimitris Papastamos, Wei Yongjun, patches, alsa-devel,
kernel-janitors
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, but this patch is superfluous
with the current state of the code.
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] ASoC: wm0010: set error code on allocation failure
2014-05-09 16:18 ` Charles Keepax
@ 2014-05-09 17:30 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-05-09 17:30 UTC (permalink / raw)
To: Charles Keepax
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Dimitris Papastamos, Wei Yongjun, patches, alsa-devel,
kernel-janitors
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-09 17:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox