From: Dan Carpenter <error27@gmail.com>
To: mhiramat@kernel.org
Cc: kernel-janitors@vger.kernel.org
Subject: [bug report] rethook: Add a generic return hook
Date: Tue, 15 Nov 2022 16:07:33 +0300 [thread overview]
Message-ID: <Y3OPFTlqLyov9zkB@kili> (raw)
Hello Masami Hiramatsu,
The patch 54ecbe6f1ed5: "rethook: Add a generic return hook" from Mar
15, 2022, leads to the following Smatch static checker warning:
kernel/trace/rethook.c:92 rethook_alloc()
warn: use 'gfp' here instead of GFP_XXX?
kernel/trace/rethook.c
89 struct rethook *rethook_alloc(void *data, rethook_handler_t handler, gfp_t gfp,
90 int size, int max)
91 {
--> 92 struct rethook *rh = kzalloc(sizeof(struct rethook), GFP_KERNEL);
"gfp" is always GFP_KERNEL so this doesn't affect runtime.
93
94 if (!rh || !handler)
95 return NULL;
96
97 rh->data = data;
98 rh->handler = handler;
99
100 /* initialize the objpool for rethook nodes */
101 if (objpool_init(&rh->pool, max, max, size, gfp, rh, rethook_init_node,
102 NULL)) {
103 kfree(rh);
104 return NULL;
105 }
106 refcount_set(&rh->ref, max + 1);
107 return rh;
108 }
regards,
dan carpenter
reply other threads:[~2022-11-15 13:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=Y3OPFTlqLyov9zkB@kili \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=mhiramat@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