Commit 1c6edb28 authored by Fabio M. De Francesco's avatar Fabio M. De Francesco Committed by Mauro Carvalho Chehab
Browse files

media: atomisp: pci: Remove checks before kfree/kvfree

Removed checks for pointers != NULL before freeing memory. If kvfree()
and kfree() are given NULL pointers no operations are performed, so
there is no need for the above-mentioned checks. Coccinelle detected the
second of the two unnecessary checks.

Link: https://lore.kernel.org/linux-media/20210527193922.25225-1-fmdefrancesco@gmail.com


Signed-off-by: default avatarFabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 693064ea
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -363,9 +363,7 @@ void sh_css_unload_firmware(void)
		unsigned int i = 0;

		for (i = 0; i < sh_css_num_binaries; i++) {
			if (fw_minibuffer[i].name)
			kfree((void *)fw_minibuffer[i].name);
			if (fw_minibuffer[i].buffer)
			kvfree(fw_minibuffer[i].buffer);
		}
		kfree(fw_minibuffer);