lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170112133857.GA56852@cairo.lkp.intel.com>
Date:   Thu, 12 Jan 2017 21:38:58 +0800
From:   kbuild test robot <lkp@...el.com>
To:     George Cherian <george.cherian@...ium.com>
Cc:     kbuild-all@...org, herbert@...dor.apana.org.au,
        davem@...emloft.net, david.daney@...ium.com,
        clabbe.montjoie@...il.com, linux-kernel@...r.kernel.org,
        linux-crypto@...r.kernel.org,
        George Cherian <george.cherian@...ium.com>
Subject: [PATCH] drivers: crypto: fix ifnullfree.cocci warnings

drivers/crypto/cavium/cpt/cptvf_reqmanager.c:312:2-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/crypto/cavium/cpt/cptvf_reqmanager.c:315:2-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/crypto/cavium/cpt/cptvf_reqmanager.c:318:2-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
drivers/crypto/cavium/cpt/cptvf_reqmanager.c:321:2-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

CC: George Cherian <george.cherian@...ium.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---

 cptvf_reqmanager.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

--- a/drivers/crypto/cavium/cpt/cptvf_reqmanager.c
+++ b/drivers/crypto/cavium/cpt/cptvf_reqmanager.c
@@ -308,17 +308,13 @@ void do_request_cleanup(struct cpt_vf *c
 		}
 	}
 
-	if (info->scatter_components)
-		kzfree(info->scatter_components);
+	kzfree(info->scatter_components);
 
-	if (info->gather_components)
-		kzfree(info->gather_components);
+	kzfree(info->gather_components);
 
-	if (info->out_buffer)
-		kzfree(info->out_buffer);
+	kzfree(info->out_buffer);
 
-	if (info->in_buffer)
-		kzfree(info->in_buffer);
+	kzfree(info->in_buffer);
 
 	if (info->completion_addr)
 		kzfree((void *)info->completion_addr);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ