public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] rethook: Add a generic return hook
@ 2022-11-15 13:07 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-11-15 13:07 UTC (permalink / raw)
  To: mhiramat; +Cc: kernel-janitors

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-15 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-15 13:07 [bug report] rethook: Add a generic return hook Dan Carpenter

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