]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - sound/pci/hda/hda_codec.c
Merge tag 'asoc-fix-v5.2-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git...
[thirdparty/kernel/stable.git] / sound / pci / hda / hda_codec.c
index b20eb7fc83eb277d9e0ebbe1353682aae3e59d82..fcdf2cd3783b5c19d1c4ce6c426bc794c6bc0b28 100644 (file)
@@ -840,7 +840,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;
 }