Commit 31604d35 authored by Markus Elfring's avatar Markus Elfring Committed by Takashi Iwai

ALSA: emu10k1: Deletion of unnecessary checks before three function calls

The functions kfree(), release_firmware() and snd_util_memhdr_free() test
whether their argument is NULL and then return immediately. Thus the test
around the call is not needed.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent b5b4a41b
...@@ -1289,9 +1289,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu) ...@@ -1289,9 +1289,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
} }
if (emu->emu1010.firmware_thread) if (emu->emu1010.firmware_thread)
kthread_stop(emu->emu1010.firmware_thread); kthread_stop(emu->emu1010.firmware_thread);
if (emu->firmware)
release_firmware(emu->firmware); release_firmware(emu->firmware);
if (emu->dock_fw)
release_firmware(emu->dock_fw); release_firmware(emu->dock_fw);
if (emu->irq >= 0) if (emu->irq >= 0)
free_irq(emu->irq, emu); free_irq(emu->irq, emu);
...@@ -1301,7 +1299,6 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu) ...@@ -1301,7 +1299,6 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
(struct snd_util_memblk *)emu->reserved_page); (struct snd_util_memblk *)emu->reserved_page);
emu->reserved_page = NULL; emu->reserved_page = NULL;
} }
if (emu->memhdr)
snd_util_memhdr_free(emu->memhdr); snd_util_memhdr_free(emu->memhdr);
if (emu->silent_page.area) if (emu->silent_page.area)
snd_dma_free_pages(&emu->silent_page); snd_dma_free_pages(&emu->silent_page);
......
...@@ -777,7 +777,6 @@ static void snd_emu10k1_ctl_private_free(struct snd_kcontrol *kctl) ...@@ -777,7 +777,6 @@ static void snd_emu10k1_ctl_private_free(struct snd_kcontrol *kctl)
kctl->private_value = 0; kctl->private_value = 0;
list_del(&ctl->list); list_del(&ctl->list);
kfree(ctl); kfree(ctl);
if (kctl->tlv.p)
kfree(kctl->tlv.p); kfree(kctl->tlv.p);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment