Powered by Linux
[PATCH] check_freeing_devm: Report the correct function name that triggered the warning — Semantic Matching Tool

[PATCH] check_freeing_devm: Report the correct function name that triggered the warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The warning message has a hard-coded 'kfree' but another function can
trigger this warning.
So, report the correct function name to be less puzzling.

Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
 check_freeing_devm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/check_freeing_devm.c b/check_freeing_devm.c
index 02587bcf5d8c..b6f639161ad8 100644
--- a/check_freeing_devm.c
+++ b/check_freeing_devm.c
@@ -36,7 +36,7 @@ static void match_free_func(const char *fn, struct expression *expr, void *_arg)
 	if (!get_state_expr(my_id, arg_expr))
 		return;
 	name = expr_to_str(arg_expr);
-	sm_warning("passing devm_ allocated variable to kfree. '%s'", name);
+	sm_warning("passing devm_ allocated variable to %s. '%s'", fn, name);
 	free_string(name);
 }
 
-- 
2.34.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux