staging: media: atomisp: pci: Remove checks before kfree/kvfree
Subsystems (4)
PATCH 1/1 staging: 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.
Signed-off-by Fabio M. De Francesco <[email protected]>
--- drivers/staging/media/atomisp/pci/sh_css_firmware.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/media/atomisp/pci/sh_css_firmware.c +2 -4
@@ -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 ;
Signature · 1 line
2.31.1
Quoted 6 lines · Fabio M. De Francesco
Removed checks for pointers != NULL before freeing memory. If
kvfree()andkfree()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.Signed-off-by Fabio M. De Francesco <[email protected]>
Acked-by Sakari Ailus <[email protected]>
Signature · 1 line
Sakari Ailus