public inbox for smatch@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] check_freeing_devm: Report the correct function name that triggered the warning
@ 2022-05-26  6:44 Christophe JAILLET
  2022-05-27  6:04 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-05-26  6:44 UTC (permalink / raw)
  To: smatch; +Cc: Christophe JAILLET

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@wanadoo.fr>
---
 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

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

* Re: [PATCH] check_freeing_devm: Report the correct function name that triggered the warning
  2022-05-26  6:44 [PATCH] check_freeing_devm: Report the correct function name that triggered the warning Christophe JAILLET
@ 2022-05-27  6:04 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2022-05-27  6:04 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: smatch

On Thu, May 26, 2022 at 08:44:39AM +0200, Christophe JAILLET wrote:
> 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@wanadoo.fr>
> ---

Thank you!  I've applied everything and pushed it.

regards,
dan carpenter

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

end of thread, other threads:[~2022-05-27  6:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-26  6:44 [PATCH] check_freeing_devm: Report the correct function name that triggered the warning Christophe JAILLET
2022-05-27  6:04 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox