From patchwork Thu Sep 14 01:08:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 9952307 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 7ABA2602C9 for ; Thu, 14 Sep 2017 01:09:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BCDF2625B for ; Thu, 14 Sep 2017 01:09:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5380C26D05; Thu, 14 Sep 2017 01:09:38 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A289289DE for ; Thu, 14 Sep 2017 01:09:36 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 96B4D267105; Thu, 14 Sep 2017 03:09:07 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 929B426710D; Thu, 14 Sep 2017 03:09:06 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by alsa0.perex.cz (Postfix) with ESMTP id 3B7B4266F0D for ; Thu, 14 Sep 2017 03:09:00 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2017 18:08:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,390,1500966000"; d="scan'208";a="900051672" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by FMSMGA003.fm.intel.com with ESMTP; 13 Sep 2017 18:08:55 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1dsIj5-0005GL-4i; Thu, 14 Sep 2017 09:13:55 +0800 Date: Thu, 14 Sep 2017 09:08:01 +0800 From: kbuild test robot To: Kuninori Morimoto Message-ID: <20170914010801.GA116841@lkp-g5.lkp.intel.com> References: <201709140825.JU3gHji0%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87a821lk11.wl%kuninori.morimoto.gx@renesas.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 Cc: Simon , Linux-ALSA , Mark Brown , kbuild-all@01.org, Dan Carpenter Subject: [alsa-devel] [PATCH] ASoC: soc-core: fix ifnullfree.cocci warnings X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP sound/soc/soc-core.c:643: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 Fixes: 7e74acb4fc31 ("ASoC: soc-core: remove rtd NULL check from soc_free_pcm_runtime()") CC: Kuninori Morimoto Signed-off-by: Fengguang Wu Acked-by: Kuninori Morimoto --- soc-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -639,8 +639,7 @@ static struct snd_soc_pcm_runtime *soc_n static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd) { - if (rtd->codec_dais) - kfree(rtd->codec_dais); + kfree(rtd->codec_dais); snd_soc_rtdcom_del_all(rtd); kfree(rtd); }