linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] tracing/kprobes: Add symbol counting check when module loads
@ 2024-07-18 18:30 Dan Carpenter
  2024-07-20 15:52 ` Masami Hiramatsu
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-07-18 18:30 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: linux-trace-kernel

Hello Masami Hiramatsu (Google),

Commit 9d8616034f16 ("tracing/kprobes: Add symbol counting check when
module loads") from Jul 5, 2024 (linux-next), leads to the following
Smatch static checker warning:

	kernel/trace/trace_kprobe.c:828 validate_probe_symbol()
	warn: missing error code here? 'try_module_get_by_name()' failed. 'ret' = '0'

kernel/trace/trace_kprobe.c
    815 static int validate_probe_symbol(char *symbol)
    816 {
    817         struct module *mod = NULL;
    818         char *modname = NULL, *p;
    819         int ret = 0;
    820 
    821         p = strchr(symbol, ':');
    822         if (p) {
    823                 modname = symbol;
    824                 symbol = p + 1;
    825                 *p = '\0';
    826                 mod = try_module_get_by_name(modname);
    827                 if (!mod)
--> 828                         goto out;

Is it intentional that "ret = 0;" here?

    829         }
    830 
    831         ret = validate_module_probe_symbol(modname, symbol);
    832 out:
    833         if (p)
    834                 *p = ':';
    835         if (mod)
    836                 module_put(mod);
    837         return ret;
    838 }

regards,
dan carpenter

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

end of thread, other threads:[~2024-07-20 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-18 18:30 [bug report] tracing/kprobes: Add symbol counting check when module loads Dan Carpenter
2024-07-20 15:52 ` Masami Hiramatsu

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 NNTP newsgroup(s).