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  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]
Date:   Thu, 21 Dec 2017 17:40:53 +0800
From:   kbuild test robot <>
To:     NeilBrown <>
Cc:, Oleg Drokin <>,
        Andreas Dilger <>,
        James Simmons <>,
        Greg Kroah-Hartman <>,
        lkml <>,
        lustre <>
Subject: [PATCH] staging: lustre: fix ifnullfree.cocci warnings

From: Fengguang Wu <>

drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:886:2-7: 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

Fixes: 862af72835c1 ("staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc.")
CC: NeilBrown <>
Signed-off-by: Fengguang Wu <>

 o2iblnd.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -882,8 +882,7 @@ void kiblnd_destroy_conn(struct kib_conn
 			    IBLND_RX_MSGS(conn) * sizeof(struct kib_rx));
-	if (conn->ibc_connvars)
-		kfree(conn->ibc_connvars);
+	kfree(conn->ibc_connvars);
 	if (conn->ibc_hdev)

Powered by blists - more mailing lists