From: Kuninori Morimoto Date: Mon, 25 Sep 2017 01:38:13 +0000 (+0000) Subject: ASoC: soc-core: remove rtd NULL check on soc_free_pcm_runtime() X-Git-Tag: v4.15-rc1~118^2~1^2~16^2~19 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=db1721f5296704d4f706a31f5d147cf7f16e3add;p=linux.git ASoC: soc-core: remove rtd NULL check on soc_free_pcm_runtime() static soc_free_pcm_runtime() is never called with rtd == NULL. This patch removes unnecessary rtd == NULL check from soc_free_pcm_runtime(). Furthermore, NULL check before kfree() is not needed. This patch removes such ckeck too. Reported-by: Dan Carpenter Signed-off-by: Fengguang Wu Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index fee4b0ef5566..091ebe198194 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -639,8 +639,7 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime( static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd) { - if (rtd && rtd->codec_dais) - kfree(rtd->codec_dais); + kfree(rtd->codec_dais); snd_soc_rtdcom_del_all(rtd); kfree(rtd); }