ALSA: Add a reference counter to card instance
[deliverable/linux.git] / sound / core / control.c
index 7e86a5b9f3b572f9c97f351027ed4e1b9b7b75b3..9768a3963c8fe5abfc4f3a37af6c4f3a8031323d 100644 (file)
@@ -86,6 +86,7 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
        write_lock_irqsave(&card->ctl_files_rwlock, flags);
        list_add_tail(&ctl->list, &card->ctl_files);
        write_unlock_irqrestore(&card->ctl_files_rwlock, flags);
+       snd_card_unref(card);
        return 0;
 
       __error:
@@ -93,6 +94,8 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
       __error2:
        snd_card_file_remove(card, file);
       __error1:
+       if (card)
+               snd_card_unref(card);
        return err;
 }
 
This page took 0.024418 seconds and 5 git commands to generate.