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: Fabio M. De Francesco <fmdefrancesco@gmail.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
693064eafa
commit
1c6edb2831
@ -363,10 +363,8 @@ 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((void *)fw_minibuffer[i].name);
|
||||
kvfree(fw_minibuffer[i].buffer);
|
||||
}
|
||||
kfree(fw_minibuffer);
|
||||
fw_minibuffer = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user