Skip to content

Commit

Permalink
ALSA: timer - Fix Oops at closing slave timer
Browse files Browse the repository at this point in the history
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: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Aug 8, 2011
1 parent 67ada83 commit 0584ffa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/core/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ int snd_timer_stop(struct snd_timer_instance *timeri)
if (err < 0)
return err;
timer = timeri->timer;
if (!timer)
return -EINVAL;
spin_lock_irqsave(&timer->lock, flags);
timeri->cticks = timeri->ticks;
timeri->pticks = 0;
Expand Down

0 comments on commit 0584ffa

Please sign in to comment.