CC: [email protected]
BCC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Steven Rostedt <[email protected]>
TO: LKML <[email protected]>
CC: Ingo Molnar <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Linux Memory Management List <[email protected]>
CC: [email protected]
CC: [email protected]
CC: Sven Schnelle <[email protected]>
CC: Ritesh Harjani <[email protected]>
CC: Jan Kara <[email protected]>
CC: "Theodore Ts'o" <[email protected]>
CC: Harshad Shirwadkar <[email protected]>

Hi Steven,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on rostedt-trace/for-next]
[also build test WARNING on ammarfaizi2-block/rostedt/linux-trace/for-next-core 
hnaz-mm/master next-20220318]
[cannot apply to linux/master linus/master v5.17]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Steven-Rostedt/tracing-Have-type-enum-modifications-copy-the-strings/20220319-033556
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git 
for-next
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: powerpc-randconfig-m031-20220321 
(https://download.01.org/0day-ci/archive/20220321/[email protected]/config)
compiler: powerpc-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
kernel/trace/trace_events.c:2657 add_str_to_module() warn: possible memory leak 
of 'modstr'

vim +/modstr +2657 kernel/trace/trace_events.c

0c564a538aa934 Steven Rostedt (Red Hat  2015-03-24  2643) 
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2644) static void 
add_str_to_module(struct module *module, char *str)
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2645) {
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2646)       struct 
module_string *modstr;
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2647) 
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2648)       modstr = 
kmalloc(sizeof(*modstr), GFP_KERNEL);
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2649) 
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2650)       /*
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2651)        * If we failed 
to allocate memory here, then we'll just
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2652)        * let the str 
memory leak when the module is removed.
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2653)        * If this 
fails to allocate, there's worse problems than
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2654)        * a leaked 
string on module removal.
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2655)        */
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2656)       if 
(WARN_ON_ONCE(!modstr))
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18 @2657)               return;
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2658) 
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2659)       modstr->module 
= module;
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2660)       modstr->str = 
str;
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2661) 
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2662)       
list_add(&modstr->next, &module_strings);
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2663) }
32f4c7cad6f15f Steven Rostedt (Google   2022-03-18  2664) 

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to