]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - sound/pci/hda/hda_codec.c
Merge tag 'sound-5.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[thirdparty/kernel/stable.git] / sound / pci / hda / hda_codec.c
index c5e46df9c5488621bd2750ccbf5fb563887ee15c..6c51b8363f8b73ccea5f8ff65558a298ddde8524 100644 (file)
@@ -826,7 +826,14 @@ static int snd_hda_codec_dev_free(struct snd_device *device)
        if (codec->core.type == HDA_DEV_LEGACY)
                snd_hdac_device_unregister(&codec->core);
        codec_display_power(codec, false);
-       put_device(hda_codec_dev(codec));
+
+       /*
+        * In the case of ASoC HD-audio bus, the device refcount is released in
+        * snd_hdac_ext_bus_device_remove() explicitly.
+        */
+       if (codec->core.type == HDA_DEV_LEGACY)
+               put_device(hda_codec_dev(codec));
+
        return 0;
 }