[PATCH 1/5] ASoC: Fix incorrect kfree in ad1836_probe error path

From: Axel Lin
Date: Tue Nov 16 2010 - 03:03:38 EST


We allocated memory for ad1836 in ad1836_spi_probe,
and will free the memory in either ad1836_spi_probe error path or
ad1836_spi_remove.

Thus we should not call kfree(ad1836) in ad1836_probe, otherwise
we have double free of ad1836.

Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
---
sound/soc/codecs/ad1836.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c
index c71b05d..e5d3db9 100644
--- a/sound/soc/codecs/ad1836.c
+++ b/sound/soc/codecs/ad1836.c
@@ -228,7 +228,6 @@ static int ad1836_probe(struct snd_soc_codec *codec)
if (ret < 0) {
dev_err(codec->dev, "failed to set cache I/O: %d\n",
ret);
- kfree(ad1836);
return ret;
}

--
1.7.2



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/