[alsa-devel] [PATCH 1/4][RESEND] ASoC: soc-core: remove rtd NULL check on soc_free_pcm_runtime()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Mon Sep 25 03:38:13 CEST 2017


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

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 <dan.carpenter at oracle.com>
Signed-off-by: Fengguang Wu <fengguang.wu at intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
v1 -> v2

 - I merged Fengguang's fixup patch into this patch

 sound/soc/soc-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index fee4b0e..091ebe1 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);
 }
-- 
1.9.1



More information about the Alsa-devel mailing list