Commit 0e47a834 authored by Amadeusz Sławiński's avatar Amadeusz Sławiński Committed by Greg Kroah-Hartman

ASoC: Intel: hdac_hdmi: Set ops to NULL on remove

[ Upstream commit 0f6ff785 ]

When we unload Skylake driver we may end up calling
hdac_component_master_unbind(), it uses acomp->audio_ops, which we set
in hdmi_codec_probe(), so we need to set it to NULL in hdmi_codec_remove(),
otherwise we will dereference no longer existing pointer.
Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ad1f4986
...@@ -1880,6 +1880,12 @@ static void hdmi_codec_remove(struct snd_soc_component *component) ...@@ -1880,6 +1880,12 @@ static void hdmi_codec_remove(struct snd_soc_component *component)
{ {
struct hdac_hdmi_priv *hdmi = snd_soc_component_get_drvdata(component); struct hdac_hdmi_priv *hdmi = snd_soc_component_get_drvdata(component);
struct hdac_device *hdev = hdmi->hdev; struct hdac_device *hdev = hdmi->hdev;
int ret;
ret = snd_hdac_acomp_register_notifier(hdev->bus, NULL);
if (ret < 0)
dev_err(&hdev->dev, "notifier unregister failed: err: %d\n",
ret);
pm_runtime_disable(&hdev->dev); pm_runtime_disable(&hdev->dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment