]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jul 2019 07:52:23 +0000 (09:52 +0200)
commit48f2ed69e872adfbd93205b3c61fa88fe9054acf
tree81c5026e58f9cb5411f29e31c7b8489a428d2f3a
parent052fd24a902693f48cfa38ad677463d48a6a4d00
ASoC: hda: fix unbalanced codec dev refcount for HDA_DEV_ASOC

[ Upstream commit d6947bb234dcc86e878d502516d0fb9d635aa2ae ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/pci/hda/hda_codec.c