summaryrefslogtreecommitdiffstats
path: root/sound/core/timer.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-08 12:28:22 +0200
committerTakashi Iwai <tiwai@suse.de>2011-08-08 12:28:22 +0200
commit94094c8aaeded11f8b99734b9ebdaada20b5f24a (patch)
tree292f1239564ff849b075632cb84a71a9aaae0981 /sound/core/timer.c
parent0584ffa548b6e59aceb027112f23a55f0133400e (diff)
downloadlinux-94094c8aaeded11f8b99734b9ebdaada20b5f24a.tar.bz2
ALSA: timer - Add NULL-check for invalid slave timer
Just to be sure. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/timer.c')
-rw-r--r--sound/core/timer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 950eed0c098e..67ebf1c21c04 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -328,6 +328,8 @@ int snd_timer_close(struct snd_timer_instance *timeri)
mutex_unlock(&register_mutex);
} else {
timer = timeri->timer;
+ if (snd_BUG_ON(!timer))
+ goto out;
/* wait, until the active callback is finished */
spin_lock_irq(&timer->lock);
while (timeri->flags & SNDRV_TIMER_IFLG_CALLBACK) {
@@ -353,6 +355,7 @@ int snd_timer_close(struct snd_timer_instance *timeri)
}
mutex_unlock(&register_mutex);
}
+ out:
if (timeri->private_free)
timeri->private_free(timeri);
kfree(timeri->owner);