From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: smatch@vger.kernel.org
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH] check_freeing_devm: Report the correct function name that triggered the warning
Date: Thu, 26 May 2022 08:44:39 +0200 [thread overview]
Message-ID: <7e4e1d104bd25fc823764c7914435d14fe34d2c6.1653547466.git.christophe.jaillet@wanadoo.fr> (raw)
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
next reply other threads:[~2022-05-26 6:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 6:44 Christophe JAILLET [this message]
2022-05-27 6:04 ` [PATCH] check_freeing_devm: Report the correct function name that triggered the warning Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e4e1d104bd25fc823764c7914435d14fe34d2c6.1653547466.git.christophe.jaillet@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=smatch@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).