diff --git a/sound/core/timer.c b/sound/core/timer.c index c0c84119a980..6d731efbbef2 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -1937,7 +1937,7 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, if (tu->disconnected) { err = -ENODEV; - break; + goto _error; } if (signal_pending(current)) { err = -ERESTARTSYS; @@ -1947,7 +1947,6 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, qhead = tu->qhead++; tu->qhead %= tu->queue_size; - tu->qused--; spin_unlock_irq(&tu->qlock); if (tu->tread) { @@ -1961,6 +1960,7 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer, } spin_lock_irq(&tu->qlock); + tu->qused--; if (err < 0) goto _error; result += unit;