From mboxrd@z Thu Jan 1 00:00:00 1970 From: kbuild test robot Subject: [PATCH] ASoC: soc-core: fix ifnullfree.cocci warnings Date: Thu, 14 Sep 2017 09:08:01 +0800 Message-ID: <20170914010801.GA116841@lkp-g5.lkp.intel.com> References: <201709140825.JU3gHji0%fengguang.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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) Content-Disposition: inline In-Reply-To: <87a821lk11.wl%kuninori.morimoto.gx@renesas.com> 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 To: Kuninori Morimoto Cc: Simon , Linux-ALSA , Mark Brown , kbuild-all@01.org, Dan Carpenter List-Id: alsa-devel@alsa-project.org 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 --- 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); }