diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-10-16 16:43:39 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-10-30 11:07:15 +0100 |
commit | 0914f7961babbf28aaa2f19b453951fb4841c03f (patch) | |
tree | fe5c14256a1d7b2116341300dd1e8ed94ac5f576 /sound/core/control.c | |
parent | a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85 (diff) | |
download | blackbird-obmc-linux-0914f7961babbf28aaa2f19b453951fb4841c03f.tar.gz blackbird-obmc-linux-0914f7961babbf28aaa2f19b453951fb4841c03f.zip |
ALSA: Avoid endless sleep after disconnect
When disconnect callback is called, each component should wake up
sleepers and check card->shutdown flag for avoiding the endless sleep
blocking the proper resource release.
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/control.c')
-rw-r--r-- | sound/core/control.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index 9768a3963c8f..8c7c2c9bba61 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -1437,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); |