diff options
Diffstat (limited to 'sound/core/timer.c')
-rw-r--r-- | sound/core/timer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c index b02681eaea7..c8496c7b8df 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
@@ -113,7 +113,7 @@ static snd_timer_instance_t *snd_timer_instance_new(char *owner, snd_timer_t *ti | |||
113 | INIT_LIST_HEAD(&timeri->slave_active_head); | 113 | INIT_LIST_HEAD(&timeri->slave_active_head); |
114 | 114 | ||
115 | timeri->timer = timer; | 115 | timeri->timer = timer; |
116 | if (timer && timer->card && !try_module_get(timer->card->module)) { | 116 | if (timer && !try_module_get(timer->module)) { |
117 | kfree(timeri->owner); | 117 | kfree(timeri->owner); |
118 | kfree(timeri); | 118 | kfree(timeri); |
119 | return NULL; | 119 | return NULL; |
@@ -363,8 +363,8 @@ int snd_timer_close(snd_timer_instance_t * timeri) | |||
363 | timeri->private_free(timeri); | 363 | timeri->private_free(timeri); |
364 | kfree(timeri->owner); | 364 | kfree(timeri->owner); |
365 | kfree(timeri); | 365 | kfree(timeri); |
366 | if (timer && timer->card) | 366 | if (timer) |
367 | module_put(timer->card->module); | 367 | module_put(timer->module); |
368 | return 0; | 368 | return 0; |
369 | } | 369 | } |
370 | 370 | ||
@@ -787,6 +787,7 @@ int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid, snd_timer_t * | |||
787 | spin_lock_init(&timer->lock); | 787 | spin_lock_init(&timer->lock); |
788 | tasklet_init(&timer->task_queue, snd_timer_tasklet, (unsigned long)timer); | 788 | tasklet_init(&timer->task_queue, snd_timer_tasklet, (unsigned long)timer); |
789 | if (card != NULL) { | 789 | if (card != NULL) { |
790 | timer->module = card->module; | ||
790 | if ((err = snd_device_new(card, SNDRV_DEV_TIMER, timer, &ops)) < 0) { | 791 | if ((err = snd_device_new(card, SNDRV_DEV_TIMER, timer, &ops)) < 0) { |
791 | snd_timer_free(timer); | 792 | snd_timer_free(timer); |
792 | return err; | 793 | return err; |