Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: hda: Deletion of unnecessary checks before two function calls

The functions kfree() and release_firmware() 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>

authored by

Markus Elfring and committed by
Takashi Iwai
f0acd28c b8eca77e

+2 -4
+1 -2
sound/pci/hda/hda_codec.c
··· 834 834 WARN_ON(!list_empty(&bus->codec_list)); 835 835 if (bus->workq) 836 836 flush_workqueue(bus->workq); 837 - if (bus->unsol) 838 - kfree(bus->unsol); 837 + kfree(bus->unsol); 839 838 if (bus->ops.private_free) 840 839 bus->ops.private_free(bus); 841 840 if (bus->workq)
+1 -2
sound/pci/hda/hda_intel.c
··· 1130 1130 pci_disable_device(chip->pci); 1131 1131 kfree(chip->azx_dev); 1132 1132 #ifdef CONFIG_SND_HDA_PATCH_LOADER 1133 - if (chip->fw) 1134 - release_firmware(chip->fw); 1133 + release_firmware(chip->fw); 1135 1134 #endif 1136 1135 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { 1137 1136 hda_display_power(false);