diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-08-08 12:24:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-15 19:01:54 -0700 |
commit | 0ef6e5ad8910506f865cf5d4d6399035b9d92aa5 (patch) | |
tree | 849e0f82f838e6ffb9d4efa250bb7d56eb66b7c2 | |
parent | 4f92dd0dba4a3000b7ce3a7dfbe2be1ffbeb2bd1 (diff) | |
download | lwn-0ef6e5ad8910506f865cf5d4d6399035b9d92aa5.tar.gz lwn-0ef6e5ad8910506f865cf5d4d6399035b9d92aa5.zip |
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>
-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 8f8b17ac074d..4a138441f799 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; |