From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: "Liam Girdwood" <lrg@slimlogic.co.uk>,
"Mark Brown" <broonie@opensource.wolfsonmicro.com>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.de>,
"André Goddard Rosa" <andre.goddard@gmail.com>,
"Jiri Kosina" <jkosina@suse.cz>,
"Vladimir Zapolskiy" <vzapolskiy@gmail.com>,
alsa-devel@alsa-project.org
Subject: [PATCH] uda134x: properly free allocated memory if uda134x_soc_probe fail with unknown codec type
Date: Fri, 16 Jul 2010 10:42:46 +0800 [thread overview]
Message-ID: <1279248166.10112.9.camel@mola> (raw)
If uda134x_soc_probe fail with unknown codec type, it should properly free
allocated memory before return -EINVAL.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
This case won't be executed in current implementation because there is a
model checking in the begin of uda134x_soc_probe.
But since the code is there, I think it's good to make it correct.
Otherwise, we can simply remove the default case.
sound/soc/codecs/uda134x.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c
index 28aac53..9bff3c6 100644
--- a/sound/soc/codecs/uda134x.c
+++ b/sound/soc/codecs/uda134x.c
@@ -566,9 +566,10 @@ static int uda134x_soc_probe(struct platform_device *pdev)
ARRAY_SIZE(uda1345_snd_controls));
break;
default:
+ ret = -EINVAL;
printk(KERN_ERR "%s unknown codec type: %d",
__func__, pd->model);
- return -EINVAL;
+ break;
}
if (ret < 0) {
--
1.5.4.3
reply other threads:[~2010-07-16 2:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1279248166.10112.9.camel@mola \
--to=axel.lin@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=andre.goddard@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
--cc=vzapolskiy@gmail.com \
/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