Return-path: Received: from mga11.intel.com ([192.55.52.93]:10494 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756103AbcILMFv (ORCPT ); Mon, 12 Sep 2016 08:05:51 -0400 Date: Mon, 12 Sep 2016 20:05:02 +0800 From: kbuild test robot To: Prameela Rani Garnepudi 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 Message-ID: <20160912120502.GA52132@lkp-hsx03> (sfid-20160912_140555_925532_E7F2BC22) References: <201609122009.NSihCWVh%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <9e848b4549d9e919eb3a772e0d292db5eee39b43.1473669618.git.prameela.j04cs@gmail.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: 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 Signed-off-by: Fengguang Wu --- 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