[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1279248166.10112.9.camel@mola>
Date: Fri, 16 Jul 2010 10:42:46 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Liam Girdwood <lrg@...mlogic.co.uk>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
André Goddard Rosa <andre.goddard@...il.com>,
Jiri Kosina <jkosina@...e.cz>,
Vladimir Zapolskiy <vzapolskiy@...il.com>,
alsa-devel@...a-project.org
Subject: [PATCH] uda134x: properly free allocated memory if
uda134x_soc_probe fail with unknown codec type
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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists