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 cd6111b262
("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>
This commit is contained in:

committed by
Mark Brown

parent
d20aa608f4
commit
f1c680f5ef
@@ -798,23 +798,11 @@ static int hdmi_codec_probe(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hdmi_codec_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct device *dev = &pdev->dev;
|
|
||||||
struct hdmi_codec_priv *hcp;
|
|
||||||
|
|
||||||
hcp = dev_get_drvdata(dev);
|
|
||||||
kfree(hcp->chmap_info);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct platform_driver hdmi_codec_driver = {
|
static struct platform_driver hdmi_codec_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = HDMI_CODEC_DRV_NAME,
|
.name = HDMI_CODEC_DRV_NAME,
|
||||||
},
|
},
|
||||||
.probe = hdmi_codec_probe,
|
.probe = hdmi_codec_probe,
|
||||||
.remove = hdmi_codec_remove,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module_platform_driver(hdmi_codec_driver);
|
module_platform_driver(hdmi_codec_driver);
|
||||||
|
Reference in New Issue
Block a user