]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: hda: fix unbalanced codec dev refcount for HDA_DEV_ASOC
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Fri, 31 May 2019 16:01:37 +0000 (09:01 -0700)
committerMark Brown <broonie@kernel.org>
Mon, 3 Jun 2019 16:43:23 +0000 (17:43 +0100)
commitf4ef24dcca7bd935d4339183eddd4ac523e27b98
treebbbae59e2c1cbd58b8b409ee5b78ad98fff72026
parent4897757b7bfdaa319bf031b603ca4751068118a2
ASoC: hda: fix unbalanced codec dev refcount for HDA_DEV_ASOC

HDA_DEV_ASOC type codec device refcounts are managed differently
from HDA_DEV_LEGACY devices. The refcount is released explicitly
in snd_hdac_ext_bus_device_remove() for ASOC type devices.
So, remove the put_device() call in snd_hda_codec_dev_free()
for such devices to make the refcount balanced. This will prevent
the NULL pointer exception when the codec driver is released
after the card is freed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/pci/hda/hda_codec.c