From patchwork Mon Sep 12 12:05:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 9326335 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9FE636077F for ; Mon, 12 Sep 2016 12:05:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EC7128551 for ; Mon, 12 Sep 2016 12:05:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E8E128CB1; Mon, 12 Sep 2016 12:05:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FC8C28551 for ; Mon, 12 Sep 2016 12:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756697AbcILMFx (ORCPT ); Mon, 12 Sep 2016 08:05:53 -0400 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 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 12 Sep 2016 05:05:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,322,1470726000"; d="scan'208";a="1028712219" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga001.jf.intel.com with ESMTP; 12 Sep 2016 05:05:48 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1bjQ09-000Ejo-38; Mon, 12 Sep 2016 20:06:17 +0800 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> References: <201609122009.NSihCWVh%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9e848b4549d9e919eb3a772e0d292db5eee39b43.1473669618.git.prameela.j04cs@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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