diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2018-02-20 07:30:10 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-02-20 09:30:57 -0500 |
commit | f1c680f5ef7ad3211bf1ae5630bd6a8219534e3c (patch) | |
tree | 84d2315d3072e361180e6158748cc8db11805487 | |
parent | d20aa608f4244868139b0a25a8afc89c5a6bf422 (diff) |
ASoC: hdmi-codec: Fix module unloading caused kernel crash
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.
Since the driver was converted to devm_snd_soc_register_component() the
whole platform_device.remove can be removed.
Commit cd6111b26280a ("ASoC: hdmi-codec: add channel mapping control")
should not have added the kfree(hcp->chmap_info); to the hdmi_codec_remove
function.
[Separate verison of the fix for -next -- broonie]
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/hdmi-codec.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 42df579cb507..6fa11888672d 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c | |||
@@ -798,23 +798,11 @@ static int hdmi_codec_probe(struct platform_device *pdev) | |||
798 | return 0; | 798 | return 0; |
799 | } | 799 | } |
800 | 800 | ||
801 | static int hdmi_codec_remove(struct platform_device *pdev) | ||
802 | { | ||
803 | struct device *dev = &pdev->dev; | ||
804 | struct hdmi_codec_priv *hcp; | ||
805 | |||
806 | hcp = dev_get_drvdata(dev); | ||
807 | kfree(hcp->chmap_info); | ||
808 | |||
809 | return 0; | ||
810 | } | ||
811 | |||
812 | static struct platform_driver hdmi_codec_driver = { | 801 | static struct platform_driver hdmi_codec_driver = { |
813 | .driver = { | 802 | .driver = { |
814 | .name = HDMI_CODEC_DRV_NAME, | 803 | .name = HDMI_CODEC_DRV_NAME, |
815 | }, | 804 | }, |
816 | .probe = hdmi_codec_probe, | 805 | .probe = hdmi_codec_probe, |
817 | .remove = hdmi_codec_remove, | ||
818 | }; | 806 | }; |
819 | 807 | ||
820 | module_platform_driver(hdmi_codec_driver); | 808 | module_platform_driver(hdmi_codec_driver); |