All of lore.kernel.org
 help / color / mirror / Atom feed
* [linusw-nomadik:gemini-cpuidle 4/4] drivers/clocksource/timer-fttmr010.c:309:3: warning: Null pointer dereference: evt [nullPointer]
@ 2022-08-28 15:19 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-08-28 15:19 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5382 bytes --]

:::::: 
:::::: Manual check reason: "low confidence static check warning: drivers/clocksource/timer-fttmr010.c:309:3: warning: Null pointer dereference: evt [nullPointer]"
:::::: 

BCC: lkp(a)intel.com
CC: kbuild-all(a)lists.01.org
CC: linux-arm-kernel(a)lists.infradead.org
TO: Linus Walleij <linus.walleij@linaro.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git gemini-cpuidle
head:   7fff44b9367cdde49fc46ed2cc683e1abf8a9bd7
commit: 7fff44b9367cdde49fc46ed2cc683e1abf8a9bd7 [4/4] slask
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
compiler: or1k-linux-gcc (GCC) 12.1.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout 7fff44b9367cdde49fc46ed2cc683e1abf8a9bd7
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/clocksource/timer-fttmr010.c:309:3: warning: Null pointer dereference: evt [nullPointer]
     evt->event_handler(evt);
     ^
   drivers/clocksource/timer-fttmr010.c:300:35: note: Assignment 'evt=NULL', assigned value is 0
    struct clock_event_device *evt = NULL;
                                     ^
   drivers/clocksource/timer-fttmr010.c:309:3: note: Null pointer dereference
     evt->event_handler(evt);
     ^

vim +309 drivers/clocksource/timer-fttmr010.c

4750535bc94b86 drivers/clocksource/timer-gemini.c   Linus Walleij 2017-01-22  293  
4750535bc94b86 drivers/clocksource/timer-gemini.c   Linus Walleij 2017-01-22  294  /*
4750535bc94b86 drivers/clocksource/timer-gemini.c   Linus Walleij 2017-01-22  295   * IRQ handler for the timer
4750535bc94b86 drivers/clocksource/timer-gemini.c   Linus Walleij 2017-01-22  296   */
f5bf0ee4ebf779 drivers/clocksource/timer-fttmr010.c Linus Walleij 2017-03-24  297  static irqreturn_t fttmr010_timer_interrupt(int irq, void *dev_id)
4750535bc94b86 drivers/clocksource/timer-gemini.c   Linus Walleij 2017-01-22  298  {
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  299  	struct fttmr010 *fttmr010 = dev_id;
7fff44b9367cdd drivers/clocksource/timer-fttmr010.c Linus Walleij 2019-09-26  300  	struct clock_event_device *evt = NULL;
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  301  	u32 val;
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  302  
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  303  	if (fttmr010->is_aspeed) {
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  304  		/*
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  305  		 * Aspeed versions do not implement the interrupt
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  306  		 * status register and cannot detect spurious
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  307  		 * interrupts.
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  308  		 */
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25 @309  		evt->event_handler(evt);
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  310  		return IRQ_HANDLED;
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  311  	}
4750535bc94b86 drivers/clocksource/timer-gemini.c   Linus Walleij 2017-01-22  312  
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  313  	val = readl(fttmr010->base + TIMER_INTR_STATE);
1808b6d9870d9c drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  314  	if (val & TIMER_1_INT_MATCH1)
7fff44b9367cdd drivers/clocksource/timer-fttmr010.c Linus Walleij 2019-09-26  315  		evt = &fttmr010->clkevt;
7fff44b9367cdd drivers/clocksource/timer-fttmr010.c Linus Walleij 2019-09-26  316  	if (val & TIMER_3_INT_MATCH1)
7fff44b9367cdd drivers/clocksource/timer-fttmr010.c Linus Walleij 2019-09-26  317  		evt = &fttmr010->extevt;
a8a95322d3167b drivers/clocksource/timer-fttmr010.c Linus Walleij 2021-07-25  318  
7fff44b9367cdd drivers/clocksource/timer-fttmr010.c Linus Walleij 2019-09-26  319  	if (evt) {
7fff44b9367cdd drivers/clocksource/timer-fttmr010.c Linus Walleij 2019-09-26  320  		evt->event_handler(evt);
4750535bc94b86 drivers/clocksource/timer-gemini.c   Linus Walleij 2017-01-22  321  		return IRQ_HANDLED;
4750535bc94b86 drivers/clocksource/timer-gemini.c   Linus Walleij 2017-01-22  322  	}
4750535bc94b86 drivers/clocksource/timer-gemini.c   Linus Walleij 2017-01-22  323  
7fff44b9367cdd drivers/clocksource/timer-fttmr010.c Linus Walleij 2019-09-26  324  	return IRQ_NONE;
7fff44b9367cdd drivers/clocksource/timer-fttmr010.c Linus Walleij 2019-09-26  325  }
7fff44b9367cdd drivers/clocksource/timer-fttmr010.c Linus Walleij 2019-09-26  326  

:::::: The code at line 309 was first introduced by commit
:::::: a8a95322d3167bf063408a85a7a012d90e841ad7 clocksource/drivers/fttmr010: Be stricter on IRQs

:::::: TO: Linus Walleij <linus.walleij@linaro.org>
:::::: CC: Linus Walleij <linus.walleij@linaro.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

only message in thread, other threads:[~2022-08-28 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-28 15:19 [linusw-nomadik:gemini-cpuidle 4/4] drivers/clocksource/timer-fttmr010.c:309:3: warning: Null pointer dereference: evt [nullPointer] kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.