diff options
author | Chuansheng Liu <chuansheng.liu@intel.com> | 2012-12-25 11:57:32 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-27 11:14:43 -0500 |
commit | d3bf1561253383a3dbcc40afdb2b039d56093a3e (patch) | |
tree | 697ee9b31a828ea02ff3d93e93e9c876bb802633 /sound/soc/soc-core.c | |
parent | 865df9cb122d9e5ecbbb7056f2c9c64933bf8dd0 (diff) |
ASoC: core: fix the memory leak in case of remove_aux_dev()
When probing aux_dev, initializing is as below:
device_initialize()
device_add()
So when remove aux_dev, we need do as below:
device_del()
device_put()
Otherwise, the rtd_release() will not be called.
So here using device_unregister() to replace device_del(),
like the action in soc_remove_link_dais().
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f7551c1c827c..2370063b5824 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1556,7 +1556,7 @@ static void soc_remove_aux_dev(struct snd_soc_card *card, int num) | |||
1556 | /* unregister the rtd device */ | 1556 | /* unregister the rtd device */ |
1557 | if (rtd->dev_registered) { | 1557 | if (rtd->dev_registered) { |
1558 | device_remove_file(rtd->dev, &dev_attr_codec_reg); | 1558 | device_remove_file(rtd->dev, &dev_attr_codec_reg); |
1559 | device_del(rtd->dev); | 1559 | device_unregister(rtd->dev); |
1560 | rtd->dev_registered = 0; | 1560 | rtd->dev_registered = 0; |
1561 | } | 1561 | } |
1562 | 1562 | ||