]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: timer - Fix Oops at closing slave timer
authorTakashi Iwai <tiwai@suse.de>
Mon, 8 Aug 2011 10:24:46 +0000 (12:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 11 Feb 2012 14:37:39 +0000 (15:37 +0100)
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>
sound/core/timer.c

index 0af337efc64e282367727e965bb36c090d0afd37..0e355861541b9a006ec703329832e2cf0f8e1972 100644 (file)
@@ -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;