From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: smatch@vger.kernel.org
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH] check_freeing_devm: Add some new devm_ function
Date: Thu, 26 May 2022 08:45:00 +0200 [thread overview]
Message-ID: <a0b33b55b6ed1115460b8d73bef08aed837b8f56.1653547494.git.christophe.jaillet@wanadoo.fr> (raw)
Add some new devm_ functions that allocate some memory which should not be
released with kfree.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
check_freeing_devm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/check_freeing_devm.c b/check_freeing_devm.c
index b6f639161ad8..11e8d8bc30b6 100644
--- a/check_freeing_devm.c
+++ b/check_freeing_devm.c
@@ -78,6 +78,10 @@ void check_freeing_devm(int id)
add_function_assign_hook("devm_kcalloc", &match_assign, NULL);
add_function_assign_hook("devm_kmalloc_array", &match_assign, NULL);
+ add_function_assign_hook("devm_kmemdup", &match_assign, NULL);
+ add_function_assign_hook("devm_kstrdup", &match_assign, NULL);
+ add_function_assign_hook("devm_kasprintf", &match_assign, NULL);
+ add_function_assign_hook("devm_kvasprintf", &match_assign, NULL);
add_function_hook("kfree", &match_free_func, INT_PTR(0));
add_function_hook("krealloc", &match_free_func, INT_PTR(0));
--
2.34.1
next reply other threads:[~2022-05-26 6:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 6:45 Christophe JAILLET [this message]
2022-05-26 11:55 ` [PATCH] check_freeing_devm: Add some new devm_ function 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=a0b33b55b6ed1115460b8d73bef08aed837b8f56.1653547494.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).