ALSA: Avoid endless sleep after disconnect
[platform/adaptation/renesas_rcar/renesas_kernel.git] / sound / core / control.c
index 9768a39..8c7c2c9 100644 (file)
@@ -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);