All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Cc: kbuild-all@01.org, linux-wireless@vger.kernel.org,
	kvalo@codeaurora.org, johannes.berg@intel.com, hofrat@osadl.org,
	prameela.j04cs@gmail.com, prameela.garnepudi@redpinesignals.com
Subject: [PATCH] rsi: fix ifnullfree.cocci warnings
Date: Mon, 12 Sep 2016 20:05:02 +0800	[thread overview]
Message-ID: <20160912120502.GA52132@lkp-hsx03> (raw)
In-Reply-To: <9e848b4549d9e919eb3a772e0d292db5eee39b43.1473669618.git.prameela.j04cs@gmail.com>

drivers/net/wireless/rsi/rsi_91x_mac80211.c:209:3-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: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -205,8 +205,7 @@ void rsi_mac80211_detach(struct rsi_hw *
 	for(i = 0; i < 2; i++) {
 		struct ieee80211_supported_band *sbands = &adapter->sbands[i];
 
-		if (sbands->channels)
-			kfree(sbands->channels);
+		kfree(sbands->channels);
 	}
 
 #ifdef CONFIG_RSI_DEBUGFS

  parent reply	other threads:[~2016-09-12 12:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12  9:38 [PATCH 0/9] rsi: code clean-up Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 1/9] rsi: cleanup and added debug prints in file rsi_91x_core.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 2/9] rsi: Spelling and code format corrections in rsi_91x_debugfs.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 3/9] rsi: Added freeing of allocated buffers (sbands and dfsentry) Cleanup (spelling mistakes, code format corrections, empty lines after declaration) Prameela Rani Garnepudi
2016-09-12 12:05   ` kbuild test robot
2016-09-12 12:05   ` kbuild test robot [this message]
2016-09-12  9:38 ` [PATCH 4/9] rsi: code clean up in file rsi_91x_main.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 5/9] rsi: code cleanup in file rsi_91x_mgmt.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 6/9] rsi: code cleanup (spelling mistakes and new line after declaration) in file rsi_91x_sdio.c Added developer name Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 7/9] rsi: zone changed for debug message and cleanup in file rsi_91x_sdio_ops.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 8/9] rsi: code clean up and replaced ctrl message timeouts with macros in file rsi_91x_usb.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 9/9] rsi: code cleanup in file rsi_91x_usb_ops.c Prameela Rani Garnepudi
2016-09-12 12:53 ` [PATCH 0/9] rsi: code clean-up Kalle Valo
2016-09-12 18:50   ` Joe Perches

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=20160912120502.GA52132@lkp-hsx03 \
    --to=lkp@intel.com \
    --cc=hofrat@osadl.org \
    --cc=johannes.berg@intel.com \
    --cc=kbuild-all@01.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=prameela.garnepudi@redpinesignals.com \
    --cc=prameela.j04cs@gmail.com \
    /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 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.