aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/timer.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-05-30 11:30:32 -0400
committerJaroslav Kysela <perex@suse.cz>2005-06-22 06:27:43 -0400
commit4d572776d4dfa2d5385a2ec3acec3cc059149e13 (patch)
treeb25ff1baa8d106561d9f07045bbfea6ac330c714 /sound/core/timer.c
parent6fd8b87f0e1e5de436ba020bd5806fe9ad738269 (diff)
[ALSA] Remove redundant NULL checks before kfree
Timer Midlevel,ALSA sequencer,ALSA<-OSS sequencer,Digigram VX core I2C tea6330t,GUS Library,VIA82xx driver,VIA82xx-modem driver CA0106 driver,CS46xx driver,EMU10K1/EMU10K2 driver,YMFPCI driver Digigram VX Pocket driver,Common EMU synth,USB generic driver,USB USX2Y Checking a pointer for NULL before calling kfree() on it is redundant, kfree() deals with NULL pointers just fine. This patch removes such checks from sound/ This patch also makes another, but closely related, change. It avoids casting pointers about to be kfree()'ed. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/timer.c')
-rw-r--r--sound/core/timer.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c
index d67a5e91a108..b498e5482d77 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -1469,14 +1469,10 @@ static int snd_timer_user_tselect(struct file *file, snd_timer_select_t __user *
1469 if ((err = snd_timer_open(&tu->timeri, str, &tselect.id, current->pid)) < 0) 1469 if ((err = snd_timer_open(&tu->timeri, str, &tselect.id, current->pid)) < 0)
1470 goto __err; 1470 goto __err;
1471 1471
1472 if (tu->queue) { 1472 kfree(tu->queue);
1473 kfree(tu->queue); 1473 tu->queue = NULL;
1474 tu->queue = NULL; 1474 kfree(tu->tqueue);
1475 } 1475 tu->tqueue = NULL;
1476 if (tu->tqueue) {
1477 kfree(tu->tqueue);
1478 tu->tqueue = NULL;
1479 }
1480 if (tu->tread) { 1476 if (tu->tread) {
1481 tu->tqueue = (snd_timer_tread_t *)kmalloc(tu->queue_size * sizeof(snd_timer_tread_t), GFP_KERNEL); 1477 tu->tqueue = (snd_timer_tread_t *)kmalloc(tu->queue_size * sizeof(snd_timer_tread_t), GFP_KERNEL);
1482 if (tu->tqueue == NULL) 1478 if (tu->tqueue == NULL)