aboutsummaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-08 12:24:46 +0200
committerWilly Tarreau <w@1wt.eu>2012-02-11 15:37:39 +0100
commite36135989b7d9f7505532bcc948292b9deecde9f (patch)
treeedffcb463f808c2c0da04a81a4ef304751789017 /sound/core
parent8a46a8fa8a6a6f91a2ed2a9716c33f02fff5ceda (diff)
ALSA: timer - Fix Oops at closing slave timer
commit 0584ffa548b6e59aceb027112f23a55f0133400e upstream. 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 Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/timer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 0af337efc64..0e355861541 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -527,6 +527,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;