]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/core/sound.c
Merge tag 'for-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power...
[linux.git] / sound / core / sound.c
index b30f027eb0fee7124756599c2bfd7c3a4bf074eb..a9ad4379523b0f4e1c6717377cad296a44d67e96 100644 (file)
@@ -134,8 +134,11 @@ static struct snd_minor *autoload_device(unsigned int minor)
        if (dev == SNDRV_MINOR_CONTROL) {
                /* /dev/aloadC? */
                int card = SNDRV_MINOR_CARD(minor);
-               if (snd_cards[card] == NULL)
+               struct snd_card *ref = snd_card_ref(card);
+               if (!ref)
                        snd_request_card(card);
+               else
+                       snd_card_unref(ref);
        } else if (dev == SNDRV_MINOR_GLOBAL) {
                /* /dev/aloadSEQ */
                snd_request_other(minor);