linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix ifnullfree.cocci warnings
@ 2018-08-14 10:57 Julia Lawall
  2018-08-14 14:03 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2018-08-14 10:57 UTC (permalink / raw)
  To: Wu Zhigang
  Cc: kbuild-all, sof-ci-monitor, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Ranjani Sridharan, Rander Wang,
	Pan Xiuli, alsa-devel, linux-kernel

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-14 14:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-14 10:57 [PATCH] fix ifnullfree.cocci warnings Julia Lawall
2018-08-14 14:03 ` Mark Brown
2018-08-14 14:10   ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).