linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: George Cherian <george.cherian@cavium.com>
Cc: kbuild-all@01.org, herbert@gondor.apana.org.au,
	davem@davemloft.net, david.daney@cavium.com,
	clabbe.montjoie@gmail.com, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org,
	George Cherian <george.cherian@cavium.com>
Subject: [PATCH] drivers: crypto: fix ifnullfree.cocci warnings
Date: Thu, 12 Jan 2017 21:38:58 +0800	[thread overview]
Message-ID: <20170112133857.GA56852@cairo.lkp.intel.com> (raw)
In-Reply-To: <1484132211-917-4-git-send-email-george.cherian@cavium.com>

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@cavium.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.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);

  parent reply	other threads:[~2017-01-12 13:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 10:56 [PATCH v4 0/3] Add Support for Cavium Cryptographic Acceleration Unit George Cherian
2017-01-11 10:56 ` [PATCH v4 1/3] drivers: crypto: Add Support for Octeon-tx CPT Engine George Cherian
2017-01-11 10:56 ` [PATCH v4 2/3] drivers: crypto: Add the Virtual Function driver for CPT George Cherian
2017-01-11 11:12   ` Stephan Müller
2017-01-11 11:28     ` George Cherian
2017-01-11 12:39       ` Stephan Müller
2017-01-12 11:10         ` George Cherian
2017-01-12 11:19           ` Stephan Müller
2017-01-12 11:20             ` George Cherian
2017-01-11 10:56 ` [PATCH v4 3/3] drivers: crypto: Enable CPT options crypto for build George Cherian
2017-01-12 12:40   ` kbuild test robot
2017-01-12 13:38   ` kbuild test robot
2017-01-12 13:38   ` kbuild test robot [this message]
2017-01-12 14:04   ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170112133857.GA56852@cairo.lkp.intel.com \
    --to=lkp@intel.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=david.daney@cavium.com \
    --cc=george.cherian@cavium.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kbuild-all@01.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).