summaryrefslogtreecommitdiff
path: root/sound/core/control.c
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-11-07 17:59:14 -0600
committerRob Herring <rob.herring@calxeda.com>2012-11-07 17:59:14 -0600
commitd3ad4a60a1b1448e59914eebefe1ccc8e64f9e2f (patch)
treef0862d1905a599cdbad86fcc8816d86a6f33459f /sound/core/control.c
parente095c0d122c09efabe7d4136ce77f72c636c4879 (diff)
parente5c5f2adeb370559f4b221d57214db85858b786a (diff)
Merge remote-tracking branch 'arm-soc/devel/debug_ll_init' into debug_ll
Diffstat (limited to 'sound/core/control.c')
-rw-r--r--sound/core/control.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 7e86a5b9f3b5..8c7c2c9bba61 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -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;
}
@@ -1434,6 +1437,8 @@ static ssize_t snd_ctl_read(struct file *file, char __user *buffer,
spin_unlock_irq(&ctl->read_lock);
schedule();
remove_wait_queue(&ctl->change_sleep, &wait);
+ if (ctl->card->shutdown)
+ return -ENODEV;
if (signal_pending(current))
return -ERESTARTSYS;
spin_lock_irq(&ctl->read_lock);