The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] uda134x: properly free allocated memory if uda134x_soc_probe fail with unknown codec type
@ 2010-07-16  2:42 Axel Lin
  0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2010-07-16  2:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	André Goddard Rosa, Jiri Kosina, Vladimir Zapolskiy,
	alsa-devel

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




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-16  2:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-16  2:42 [PATCH] uda134x: properly free allocated memory if uda134x_soc_probe fail with unknown codec type Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox