diff options
author | Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> | 2019-06-17 13:36:42 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-06-25 15:33:25 +0100 |
commit | 0f6ff78540bd1b4df1e0f17806b0ce2e1dff0d78 (patch) | |
tree | 61d97aebf69e7e97b8e3911fea19055bd2b21135 /sound | |
parent | 6ee927f2f014668c5fe920d0fd1a6ad48671bfce (diff) | |
download | linux-0f6ff78540bd1b4df1e0f17806b0ce2e1dff0d78.tar.bz2 |
ASoC: Intel: hdac_hdmi: Set ops to NULL on remove
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: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/hdac_hdmi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 660e0587f399..da3835b703f5 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1867,6 +1867,12 @@ static void hdmi_codec_remove(struct snd_soc_component *component) { struct hdac_hdmi_priv *hdmi = snd_soc_component_get_drvdata(component); 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); } |