ALSA: Add a reference counter to card instance
[deliverable/linux.git] / sound / core / control.c
index 2487a6bb1c545a3338aa19fbd244c952724f1058..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;
 }
 
@@ -246,6 +249,7 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol,
        kctl.count = ncontrol->count ? ncontrol->count : 1;
        access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE :
                 (ncontrol->access & (SNDRV_CTL_ELEM_ACCESS_READWRITE|
+                                     SNDRV_CTL_ELEM_ACCESS_VOLATILE|
                                      SNDRV_CTL_ELEM_ACCESS_INACTIVE|
                                      SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE|
                                      SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND|
This page took 0.042825 seconds and 5 git commands to generate.