ASoC: Fix incorrect kfree in error path
Subsystems (5)
cover ASoC: Fix incorrect kfree in error path
This serial of patches fixes incorrect kfree in error path.
Axel Lin (5):
ASoC: Fix incorrect kfree in ad1836_probe error path
ASoC: Fix incorrect kfree in ad193x_probe error path
ASoC: Fix incorrect kfree in aic3x_probe error path
ASoC: Fix incorrect kfree in wm8731_probe error path
ASoC: Fix incorrect kfree in wm8962_probe error path
sound/soc/codecs/ad1836.c | 1 - sound/soc/codecs/ad193x.c | 1 - sound/soc/codecs/tlv320aic3x.c | 1 - sound/soc/codecs/wm8731.c | 1 - sound/soc/codecs/wm8962.c | 1 - 5 files changed, 0 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.2
PATCH 1/5 ASoC: Fix incorrect kfree in ad1836_probe error path
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.
--- sound/soc/codecs/ad1836.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
sound/soc/codecs/ad1836.c +0 -1
@@ -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; }
Signature · 1 line
1.7.2
PATCH 2/5 ASoC: Fix incorrect kfree in ad193x_probe error path
We allocated memory for ad193x in ad193x_spi_probe,
and will free the memory in either ad193x_spi_probe error path or ad193x_spi_remove.
Thus we should not call kfree(ad193x) in ad193x_probe, otherwise we have double free of ad193x.
--- sound/soc/codecs/ad193x.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
sound/soc/codecs/ad193x.c +0 -1
@@ -364,7 +364,6 @@ static int ad193x_probe(struct snd_soc_codec *codec)if (ret <0 ) {dev_err (codec->dev,"failed to set cache I/O: %d\n" , ret); -kfree (ad193x);return ret; }
Signature · 1 line
1.7.2
PATCH 3/5 ASoC: Fix incorrect kfree in aic3x_probe error path
We allocated memory for aic3x in aic3x_i2c_probe,
and will free the memory in either aic3x_i2c_probe error path or aic3x_i2c_remove.
Thus we should not call kfree(aic3x) in aic3x_probe, otherwise we have double free of aic3x.
--- sound/soc/codecs/tlv320aic3x.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
sound/soc/codecs/tlv320aic3x.c +0 -1
@@ -1419,7 +1419,6 @@ err_get:if (aic3x->gpio_reset >=0 )gpio_free (aic3x->gpio_reset); err_gpio: -kfree (aic3x);return ret; }
Signature · 1 line
1.7.2
PATCH 4/5 ASoC: Fix incorrect kfree in wm8731_probe error path
We allocated memory for wm8731 in wm8731_spi_probe / wm8731_i2c_probe, and will free the memory in either wm8731_spi_probe / wm8731_i2c_probe error path or wm8731_spi_remove / wm8731_i2c_remove.
Thus we should not call kfree(wm8731) in wm8731_probe, otherwise we have double free of wm8731.
--- sound/soc/codecs/wm8731.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8731.c +0 -1
@@ -543,7 +543,6 @@ err_regulator_enable: err_regulator_get:regulator_bulk_free (ARRAY_SIZE (wm8731->supplies), wm8731->supplies); -kfree (wm8731);return ret; }
Signature · 1 line
1.7.2
PATCH 5/5 ASoC: Fix incorrect kfree in wm8962_probe error path
We allocated memory for wm8962 in wm8962_i2c_probe, and will free the memory in either wm8962_i2c_probe error path or wm8962_i2c_remove.
Thus we should not call kfree(wm8962) in wm8962_probe, otherwise we have double free of wm8962.
--- sound/soc/codecs/wm8962.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8962.c +0 -1
@@ -3874,7 +3874,6 @@ err_enable: err_get:regulator_bulk_free (ARRAY_SIZE (wm8962->supplies), wm8962->supplies); err: -kfree (wm8962);return ret; }
Signature · 1 line
1.7.2
Quoted 9 lines · Axel Lin
This serial of patches fixes incorrect kfree in error path.
Axel Lin (5):
ASoC: Fix incorrect kfree inad1836_probeerror path
ASoC: Fix incorrect kfree inad193x_probeerror path
ASoC: Fix incorrect kfree inaic3x_probeerror path
ASoC: Fix incorrect kfree inwm8731_probeerror path
ASoC: Fix incorrect kfree inwm8962_probeerror path
Quoted 7 lines
sound/soc/codecs/ad1836.c | 1 - sound/soc/codecs/ad193x.c | 1 - sound/soc/codecs/tlv320aic3x.c | 1 - sound/soc/codecs/wm8731.c | 1 - sound/soc/codecs/wm8962.c | 1 - 5 files changed, 0 insertions(+), 5 deletions(-)
All
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk
Mark Brown
AppliedQuoted 4 lines · Liam Girdwood
Quoted 1 line · Axel Lin
This serial of patches fixes incorrect kfree in error path.
All
Applied, thanks.