aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2014-11-03 08:54:36 -0500
committerTakashi Iwai <tiwai@suse.de>2014-11-03 09:16:14 -0500
commit31604d35db18c1382c7ee9fa836ff9ab0b4d2751 (patch)
treef55e9f94fba3a32c6c29921f8242c4e3cbf7df2b /sound/pci
parentb5b4a41b392960010fccf1f9ccf8334d612bd450 (diff)
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: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c9
-rw-r--r--sound/pci/emu10k1/emufx.c3
2 files changed, 4 insertions, 8 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 229269788023..b4458a630a7c 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -1289,10 +1289,8 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
1289 } 1289 }
1290 if (emu->emu1010.firmware_thread) 1290 if (emu->emu1010.firmware_thread)
1291 kthread_stop(emu->emu1010.firmware_thread); 1291 kthread_stop(emu->emu1010.firmware_thread);
1292 if (emu->firmware) 1292 release_firmware(emu->firmware);
1293 release_firmware(emu->firmware); 1293 release_firmware(emu->dock_fw);
1294 if (emu->dock_fw)
1295 release_firmware(emu->dock_fw);
1296 if (emu->irq >= 0) 1294 if (emu->irq >= 0)
1297 free_irq(emu->irq, emu); 1295 free_irq(emu->irq, emu);
1298 /* remove reserved page */ 1296 /* remove reserved page */
@@ -1301,8 +1299,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
1301 (struct snd_util_memblk *)emu->reserved_page); 1299 (struct snd_util_memblk *)emu->reserved_page);
1302 emu->reserved_page = NULL; 1300 emu->reserved_page = NULL;
1303 } 1301 }
1304 if (emu->memhdr) 1302 snd_util_memhdr_free(emu->memhdr);
1305 snd_util_memhdr_free(emu->memhdr);
1306 if (emu->silent_page.area) 1303 if (emu->silent_page.area)
1307 snd_dma_free_pages(&emu->silent_page); 1304 snd_dma_free_pages(&emu->silent_page);
1308 if (emu->ptb_pages.area) 1305 if (emu->ptb_pages.area)
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 745f0627c634..eb5c0aba41c1 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -777,8 +777,7 @@ static void snd_emu10k1_ctl_private_free(struct snd_kcontrol *kctl)
777 kctl->private_value = 0; 777 kctl->private_value = 0;
778 list_del(&ctl->list); 778 list_del(&ctl->list);
779 kfree(ctl); 779 kfree(ctl);
780 if (kctl->tlv.p) 780 kfree(kctl->tlv.p);
781 kfree(kctl->tlv.p);
782} 781}
783 782
784static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu, 783static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu,