diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-08-08 12:24:46 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-08-08 12:24:46 +0200 |
commit | 0584ffa548b6e59aceb027112f23a55f0133400e (patch) | |
tree | ec5b83bf7323428554f6170fc421f022b51426df /sound | |
parent | 67ada8367c323ce13d0268c87cf09bf8af956e92 (diff) | |
download | linux-3.10-0584ffa548b6e59aceb027112f23a55f0133400e.tar.gz linux-3.10-0584ffa548b6e59aceb027112f23a55f0133400e.tar.bz2 linux-3.10-0584ffa548b6e59aceb027112f23a55f0133400e.zip |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/timer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c index 7c1cbf0a0dc..950eed0c098 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -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; |