aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core')
-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)
328 mutex_unlock(&register_mutex); 328 mutex_unlock(&register_mutex);
329 } else { 329 } else {
330 timer = timeri->timer; 330 timer = timeri->timer;
331 if (snd_BUG_ON(!timer))
332 goto out;
331 /* wait, until the active callback is finished */ 333 /* wait, until the active callback is finished */
332 spin_lock_irq(&timer->lock); 334 spin_lock_irq(&timer->lock);
333 while (timeri->flags & SNDRV_TIMER_IFLG_CALLBACK) { 335 while (timeri->flags & SNDRV_TIMER_IFLG_CALLBACK) {
@@ -353,6 +355,7 @@ int snd_timer_close(struct snd_timer_instance *timeri)
353 } 355 }
354 mutex_unlock(&register_mutex); 356 mutex_unlock(&register_mutex);
355 } 357 }
358 out:
356 if (timeri->private_free) 359 if (timeri->private_free)
357 timeri->private_free(timeri); 360 timeri->private_free(timeri);
358 kfree(timeri->owner); 361 kfree(timeri->owner);