All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: fix ifnullfree.cocci warnings
  2016-11-28 17:42 [cryptodev:master 89/113] crypto/lrw.c:313: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 kbuild test robot
@ 2016-11-28 17:42 ` kbuild test robot
  2016-11-29  6:35   ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2016-11-28 17:42 UTC (permalink / raw)
  To: Herbert Xu; +Cc: kbuild-all, linux-crypto

crypto/lrw.c:313: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

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -309,8 +309,7 @@ static void exit_crypt(struct skcipher_r
 
 	rctx->left = 0;
 
-	if (rctx->ext)
-		kfree(rctx->ext);
+	kfree(rctx->ext);
 }
 
 static int do_encrypt(struct skcipher_request *req, int err)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [cryptodev:master 89/113] crypto/lrw.c:313: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.
@ 2016-11-28 17:42 kbuild test robot
  2016-11-28 17:42 ` [PATCH] crypto: fix ifnullfree.cocci warnings kbuild test robot
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2016-11-28 17:42 UTC (permalink / raw)
  To: Herbert Xu; +Cc: kbuild-all, linux-crypto

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   eb0955935e2ae3aa1fc9c34ec684ffe086e81da7
commit: 700cb3f5fe755b1a2d0f5cf3ae89ad7ef69d321f [89/113] crypto: lrw - Convert to skcipher


coccinelle warnings: (new ones prefixed by >>)

>> crypto/lrw.c:313: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.

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypto: fix ifnullfree.cocci warnings
  2016-11-28 17:42 ` [PATCH] crypto: fix ifnullfree.cocci warnings kbuild test robot
@ 2016-11-29  6:35   ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2016-11-29  6:35 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, linux-crypto

On Tue, Nov 29, 2016 at 01:42:38AM +0800, kbuild test robot wrote:
> crypto/lrw.c:313: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
> 
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Please keep it as it is.  This function is performance-critical
and the if clause does make a measurable difference.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] crypto: fix ifnullfree.cocci warnings
  2016-11-28 17:55 [cryptodev:master 90/113] crypto/xts.c:254: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 kbuild test robot
@ 2016-11-28 17:55 ` kbuild test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2016-11-28 17:55 UTC (permalink / raw)
  To: Herbert Xu; +Cc: kbuild-all, linux-crypto

crypto/xts.c:254: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

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -250,8 +250,7 @@ static void exit_crypt(struct skcipher_r
 
 	rctx->left = 0;
 
-	if (rctx->ext)
-		kzfree(rctx->ext);
+	kzfree(rctx->ext);
 }
 
 static int do_encrypt(struct skcipher_request *req, int err)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-29  6:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-28 17:42 [cryptodev:master 89/113] crypto/lrw.c:313: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 kbuild test robot
2016-11-28 17:42 ` [PATCH] crypto: fix ifnullfree.cocci warnings kbuild test robot
2016-11-29  6:35   ` Herbert Xu
2016-11-28 17:55 [cryptodev:master 90/113] crypto/xts.c:254: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 kbuild test robot
2016-11-28 17:55 ` [PATCH] crypto: fix ifnullfree.cocci warnings kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.