Skip to content

Commit

Permalink
ASoC: core: fix the memory leak in case of remove_aux_dev()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chuansheng Liu authored and Mark Brown committed Dec 27, 2012
1 parent 865df9c commit d3bf156
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ static void soc_remove_aux_dev(struct snd_soc_card *card, int num)
/* unregister the rtd device */
if (rtd->dev_registered) {
device_remove_file(rtd->dev, &dev_attr_codec_reg);
device_del(rtd->dev);
device_unregister(rtd->dev);
rtd->dev_registered = 0;
}

Expand Down

0 comments on commit d3bf156

Please sign in to comment.