mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Wu Zhigang <zhigang.wu@linux.intel.com>
Cc: kbuild-all@01.org, sof-ci-monitor@eclists.intel.com,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Rander Wang <rander.wang@linux.intel.com>,
	Pan Xiuli <xiuli.pan@linux.intel.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: [PATCH] fix ifnullfree.cocci warnings
Date: Tue, 14 Aug 2018 12:57:57 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1808141255470.3371@hadrien> (raw)

From: kbuild test robot <fengguang.wu@intel.com>

 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: 0099cc17a399 ("ASoC:topology:avoid error log and oops during topology free.")
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

Feel free to ignore this if the null test is useful in some way.

 topology.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2165,8 +2165,7 @@ void snd_sof_free_topology(struct snd_so
 		/* free sroute and its private data */
 		kfree(sroute->route->source);
 		kfree(sroute->route->sink);
-		if (sroute->route->control)
-			kfree(sroute->route->control);
+		kfree(sroute->route->control);
 		kfree(sroute->route);
 		kfree(sroute->private);
 		kfree(sroute);

             reply	other threads:[~2018-08-14 10:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 10:57 Julia Lawall [this message]
2018-08-14 14:03 ` Mark Brown
2018-08-14 14:10   ` Julia Lawall

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=alpine.DEB.2.20.1808141255470.3371@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kbuild-all@01.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rander.wang@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sof-ci-monitor@eclists.intel.com \
    --cc=tiwai@suse.com \
    --cc=xiuli.pan@linux.intel.com \
    --cc=zhigang.wu@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®