ALSA: hdac: fix memory release for SST and SOF drivers
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Wed, 22 May 2019 16:21:41 +0000 (11:21 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jul 2019 07:53:36 +0000 (09:53 +0200)
commit1023af0c069d2af061d8e3992deef48126b7e84b
tree49086c4faf74ce0e3b112ef7010f95e3ae4b1685
parent26a6acde2a42d8e0f23dffb172b4c1cbc9d14f9e
ALSA: hdac: fix memory release for SST and SOF drivers

[ Upstream commit 6d647b736a6b1cbf2f8deab0e6a94c34a6ea9d60 ]

During the integration of HDaudio support, we changed the way in which
we get hdev in snd_hdac_ext_bus_device_init() to use one preallocated
with devm_kzalloc(), however it still left kfree(hdev) in
snd_hdac_ext_bus_device_exit(). It leads to oopses when trying to
rmmod and modprobe. Fix it, by just removing kfree call.

SOF also uses some of the snd_hdac_ functions for HDAudio support but
allocated the memory with kzalloc. A matching fix is provided
separately to align all users of the snd_hdac_ library.

Fixes: 6298542fa33b ("ALSA: hdac: remove memory allocation from snd_hdac_ext_bus_device_init")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/hda/ext/hdac_ext_bus.c