From mboxrd@z Thu Jan 1 00:00:00 1970 From: kbuild test robot Subject: Re: [PATCH bpf-next] bpf: support raw tracepoints in modules Date: Sat, 17 Nov 2018 05:55:00 +0800 Message-ID: <201811170557.4EtvwhsA%fengguang.wu@intel.com> References: <20181109220632.3944136-1-mmullins@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kbuild-all@01.org, ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, kernel-team@fb.com, Matt Mullins , Jessica Yu , Steven Rostedt , Ingo Molnar , linux-kernel@vger.kernel.org To: Matt Mullins Return-path: Content-Disposition: inline In-Reply-To: <20181109220632.3944136-1-mmullins@fb.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Hi Matt, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on bpf-next/master] url: https://github.com/0day-ci/linux/commits/Matt-Mullins/bpf-support-raw-tracepoints-in-modules/20181110-144839 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master smatch warnings: kernel/trace/bpf_trace.c:1284 bpf_event_notify() error: potential null dereference 'btm'. (kzalloc returns null) vim +/btm +1284 kernel/trace/bpf_trace.c 1269 1270 #ifdef CONFIG_MODULES 1271 int bpf_event_notify(struct notifier_block *nb, unsigned long op, void *module) 1272 { 1273 struct bpf_trace_module *btm, *tmp; 1274 struct module *mod = module; 1275 1276 if (mod->num_bpf_raw_events == 0) 1277 return 0; 1278 1279 mutex_lock(&bpf_module_mutex); 1280 1281 switch (op) { 1282 case MODULE_STATE_COMING: 1283 btm = kzalloc(sizeof(*btm), GFP_KERNEL); > 1284 btm->module = module; 1285 list_add(&btm->list, &bpf_trace_modules); 1286 break; 1287 case MODULE_STATE_GOING: 1288 list_for_each_entry_safe(btm, tmp, &bpf_trace_modules, list) { 1289 if (btm->module == module) { 1290 list_del(&btm->list); 1291 kfree(btm); 1292 break; 1293 } 1294 } 1295 break; 1296 } 1297 1298 mutex_unlock(&bpf_module_mutex); 1299 1300 return 0; 1301 } 1302 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation