summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-08 12:24:46 +0200
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-05-17 11:21:28 -0400
commit1b9e5abe55f28d4b104d398347e680f2b040e0ca (patch)
tree616a995a63924e1ac419c42f055274fc660d6bb7 /sound
parent41fc877e94ead29c23b76601f420e3a3315a9375 (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: Paul Gortmaker <paul.gortmaker@windriver.com>
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 5040c7b862fe..ecb2dd500a10 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;