aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-08 12:24:46 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-15 18:57:20 -0700
commitb80a78266d3495ab002fd2eb543e2f12be25591a (patch)
treeaea1248180af5470e72525ea95411fd34d09a4f0 /sound
parent263b89378807581c501e4673634fee5253126812 (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>
Diffstat (limited to 'sound')
-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 8f8b17ac074..4a138441f79 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -530,6 +530,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;