[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1808141255470.3371@hadrien>
Date: Tue, 14 Aug 2018 12:57:57 +0200 (CEST)
From: Julia Lawall <julia.lawall@...6.fr>
To: Wu Zhigang <zhigang.wu@...ux.intel.com>
cc: kbuild-all@...org, sof-ci-monitor@...ists.intel.com,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Rander Wang <rander.wang@...ux.intel.com>,
Pan Xiuli <xiuli.pan@...ux.intel.com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: [PATCH] fix ifnullfree.cocci warnings
From: kbuild test robot <fengguang.wu@...el.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@...el.com>
Signed-off-by: Julia Lawall <julia.lawall@...6.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);
Powered by blists - more mailing lists