All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>, Simon <horms@verge.net.au>
Subject: [PATCH 1/4][RESEND] ASoC: soc-core: remove rtd NULL check on soc_free_pcm_runtime()
Date: Mon, 25 Sep 2017 01:38:13 +0000	[thread overview]
Message-ID: <87ing7pnt2.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87k20npnwd.wl%kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@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@oracle.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@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

  reply	other threads:[~2017-09-25  1:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25  1:36 [PATCH 0/4][RESEND] ASoC: rtd NULL check and unneeded ops check Kuninori Morimoto
2017-09-25  1:38 ` Kuninori Morimoto [this message]
2017-09-25 16:31   ` Applied "ASoC: soc-core: remove rtd NULL check on soc_free_pcm_runtime()" to the asoc tree Mark Brown
2017-09-25  1:38 ` [PATCH 2/4][RESEND] ASoC: remove unneeded dai->driver check Kuninori Morimoto
2017-09-25 16:31   ` Applied "ASoC: remove unneeded dai->driver check" to the asoc tree Mark Brown
2017-09-25  1:38 ` [PATCH 3/4][RESEND] ASoC: remove unneeded dai->driver->ops check Kuninori Morimoto
2017-09-25 16:31   ` Applied "ASoC: remove unneeded dai->driver->ops check" to the asoc tree Mark Brown
2017-09-25  1:39 ` [PATCH 4/4][RESEND] ASoC: add null_snd_soc_ops and reduce NULL ops check Kuninori Morimoto
2017-09-25 16:34   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ing7pnt2.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=horms@verge.net.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.