Skip to content

Commit 0584ffa

Browse files
committed
ALSA: timer - Fix Oops at closing slave timer
A slave-timer instance has no timer reference, and this results in NULL-dereference at stopping the timer, typically called at closing the device. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=40682 Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 67ada83 commit 0584ffa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎sound/core/timer.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ int snd_timer_stop(struct snd_timer_instance *timeri)
531531
if (err < 0)
532532
return err;
533533
timer = timeri->timer;
534+
if (!timer)
535+
return -EINVAL;
534536
spin_lock_irqsave(&timer->lock, flags);
535537
timeri->cticks = timeri->ticks;
536538
timeri->pticks = 0;

0 commit comments

Comments
 (0)