Skip to contentSkip to conversation

fix ifnullfree.cocci warnings

PATCH In review Julia Lawall 2 participants 3 messages Aug 14, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix ifnullfree.cocci warnings

From: kbuild test robot <[email protected]>

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.")

---

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

 topology.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/sof/topology.c +1 -2
@@ -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);
maintainer
#1 lore raw
Quoted 11 lines · Julia Lawall

From: kbuild test robot <[email protected]>

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.")

This doesn't apply against current code, please check and resend (the above commit isn't in my tree:

$ git show 0099cc17a399
fatal: ambiguous argument '0099cc17a399': unknown revision or path not in the working tree.
#2 lore raw
Quoted 11 lines · Mark Brown
Quoted 10 lines · Julia Lawall

From: kbuild test robot <[email protected]>

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

Quoted 7 lines
Quoted 1 line
Fixes 0099cc17a399 ("ASoC:topology:avoid error log and oops during topology free.")

This doesn't apply against current code, please check and resend (the above commit isn't in my tree:

$ git show 0099cc17a399
fatal: ambiguous argument '0099cc17a399': unknown revision or path not in the working tree.

Sorry, I didn't keep the tree information.

julia