From: Lukas Wunner Date: Thu, 20 Oct 2016 10:26:16 +0000 (+0200) Subject: ASoC: Intel: Skylake: Always acquire runtime pm ref on unload X-Git-Tag: v4.8.9~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2140d4fd92772a4623514a18a7dd790fc57dc004;p=thirdparty%2Fkernel%2Fstable.git ASoC: Intel: Skylake: Always acquire runtime pm ref on unload commit 6d13f62d931ba638e54ba56f3a7dd3080ffb485a upstream. skl_probe() releases a runtime pm ref unconditionally wheras skl_remove() acquires one only if the device is wakeup capable. Thus if the device is not wakeup capable, unloading and reloading the module will result in the refcount being decreased below 0. Fix it. Fixes: d8c2dab8381d ("ASoC: Intel: Add Skylake HDA audio driver") Signed-off-by: Lukas Wunner Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index e3e7641677657..7b7a380b12452 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -785,8 +785,7 @@ static void skl_remove(struct pci_dev *pci) release_firmware(skl->tplg); - if (pci_dev_run_wake(pci)) - pm_runtime_get_noresume(&pci->dev); + pm_runtime_get_noresume(&pci->dev); /* codec removal, invoke bus_device_remove */ snd_hdac_ext_bus_device_remove(ebus);