ASoC: hdmi-codec: Fix module unloading caused kernel crash
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Tue, 20 Feb 2018 14:19:05 +0000 (16:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:51 +0000 (16:17 +0200)
commit98ffb5cf47e4d0b9c0bf0f53e20cff00d1ba7ee2
tree3eb3f4dc97c7d6fed3956e5665305fb21a50255d
parent48e835f89769a1fcb1cf15259c734600891d87f5
ASoC: hdmi-codec: Fix module unloading caused kernel crash

[ Upstream commit 5e558f8afaec8957932b1dbe5aeff800f9fc6957 ]

The hcp->chmap_info must not be freed up in the hdmi_codec_remove()
function as it leads to kernel crash due ALSA core's
pcm_chmap_ctl_private_free() is trying to free it up again when the card
destroyed via snd_card_free.

Commit cd6111b26280a ("ASoC: hdmi-codec: add channel mapping control")
should not have added the kfree(hcp->chmap_info); to the hdmi_codec_remove
function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Jyri Sarha <jsarha@ti.com>
Tested-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/codecs/hdmi-codec.c