tree:
https://github.com/0day-ci/linux/commits/UPDATE-20201116-151039/Yu-Kuai/c...
head: 05b62d74281ba2bacf59b6d023dddbdb019ed280
commit: 05b62d74281ba2bacf59b6d023dddbdb019ed280 [1/1] clocksource/drivers/cadence_ttc:
fix memory leak in ttc_setup_clockevent()
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
#
https://github.com/0day-ci/linux/commit/05b62d74281ba2bacf59b6d023dddbdb0...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
UPDATE-20201116-151039/Yu-Kuai/clocksource-drivers-cadence_ttc-fix-memory-leak-in-ttc_setup_clockevent/20201110-091242
git checkout 05b62d74281ba2bacf59b6d023dddbdb019ed280
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/clocksource/timer-cadence-ttc.c: In function 'ttc_setup_clockevent':
> drivers/clocksource/timer-cadence-ttc.c:417:3: error:
'go' undeclared (first use in this function)
417 | go out_kfree;
| ^~
drivers/clocksource/timer-cadence-ttc.c:417:3: note: each undeclared identifier is
reported only once for each function it appears in
> drivers/clocksource/timer-cadence-ttc.c:417:5: error: expected
';' before 'out_kfree'
417 | go out_kfree;
| ^~~~~~~~~~
| ;
vim +/go +417 drivers/clocksource/timer-cadence-ttc.c
402
403 static int __init ttc_setup_clockevent(struct clk *clk,
404 void __iomem *base, u32 irq)
405 {
406 struct ttc_timer_clockevent *ttcce;
407 int err;
408
409 ttcce = kzalloc(sizeof(*ttcce), GFP_KERNEL);
410 if (!ttcce)
411 return -ENOMEM;
412
413 ttcce->ttc.clk = clk;
414
415 err = clk_prepare_enable(ttcce->ttc.clk);
416 if (err)
417 go out_kfree;
418
419 ttcce->ttc.clk_rate_change_nb.notifier_call =
420 ttc_rate_change_clockevent_cb;
421 ttcce->ttc.clk_rate_change_nb.next = NULL;
422
423 err = clk_notifier_register(ttcce->ttc.clk,
424 &ttcce->ttc.clk_rate_change_nb);
425 if (err) {
426 pr_warn("Unable to register clock notifier.\n");
427 goto out_kfree;
428 }
429
430 ttcce->ttc.freq = clk_get_rate(ttcce->ttc.clk);
431
432 ttcce->ttc.base_addr = base;
433 ttcce->ce.name = "ttc_clockevent";
434 ttcce->ce.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
435 ttcce->ce.set_next_event = ttc_set_next_event;
436 ttcce->ce.set_state_shutdown = ttc_shutdown;
437 ttcce->ce.set_state_periodic = ttc_set_periodic;
438 ttcce->ce.set_state_oneshot = ttc_shutdown;
439 ttcce->ce.tick_resume = ttc_resume;
440 ttcce->ce.rating = 200;
441 ttcce->ce.irq = irq;
442 ttcce->ce.cpumask = cpu_possible_mask;
443
444 /*
445 * Setup the clock event timer to be an interval timer which
446 * is prescaled by 32 using the interval interrupt. Leave it
447 * disabled for now.
448 */
449 writel_relaxed(0x23, ttcce->ttc.base_addr + TTC_CNT_CNTRL_OFFSET);
450 writel_relaxed(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN,
451 ttcce->ttc.base_addr + TTC_CLK_CNTRL_OFFSET);
452 writel_relaxed(0x1, ttcce->ttc.base_addr + TTC_IER_OFFSET);
453
454 err = request_irq(irq, ttc_clock_event_interrupt,
455 IRQF_TIMER, ttcce->ce.name, ttcce);
456 if (err)
457 goto out_kfree;
458
459 clockevents_config_and_register(&ttcce->ce,
460 ttcce->ttc.freq / PRESCALE, 1, 0xfffe);
461
462 return 0;
463
464 out_kfree:
465 kfree(ttcce);
466 return err;
467 }
468
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org