All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/pinctrl/renesas/core.c:131:16: warning: Possible null pointer dereference: r [nullPointer]
Date: Wed, 21 Jul 2021 03:56:42 +0800	[thread overview]
Message-ID: <202107210334.xdJsJNC9-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Julian Braha <julianbraha@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>

Hi Julian,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8cae8cd89f05f6de223d63e6d15e31c8ba9cf53b
commit: 7d37cb2c912dc5c25ffac784a4f9b98c06c6bd08 lib: fix kconfig dependency on ARCH_WANT_FRAME_POINTERS
date:   3 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 3 months ago
compiler: csky-linux-gcc (GCC) 10.3.0

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


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

>> drivers/pinctrl/renesas/core.c:131:16: warning: Possible null pointer dereference: r [nullPointer]
    if (enum_id < r->begin)
                  ^
   drivers/pinctrl/renesas/core.c:323:11: note: Assignment 'range=NULL', assigned value is 0
     range = NULL;
             ^
   drivers/pinctrl/renesas/core.c:371:46: note: Calling function 'sh_pfc_enum_in_range', 2nd argument 'range' value is 0
       in_range = sh_pfc_enum_in_range(enum_id, range);
                                                ^
   drivers/pinctrl/renesas/core.c:131:16: note: Null pointer dereference
    if (enum_id < r->begin)
                  ^
   drivers/pinctrl/renesas/core.c:134:16: warning: Possible null pointer dereference: r [nullPointer]
    if (enum_id > r->end)
                  ^
   drivers/pinctrl/renesas/core.c:323:11: note: Assignment 'range=NULL', assigned value is 0
     range = NULL;
             ^
   drivers/pinctrl/renesas/core.c:371:46: note: Calling function 'sh_pfc_enum_in_range', 2nd argument 'range' value is 0
       in_range = sh_pfc_enum_in_range(enum_id, range);
                                                ^
   drivers/pinctrl/renesas/core.c:134:16: note: Null pointer dereference
    if (enum_id > r->end)
                  ^

vim +131 drivers/pinctrl/renesas/core.c

934cb02bab9003 drivers/pinctrl/sh-pfc/core.c Laurent Pinchart 2013-02-14  128  
533743dccb517b drivers/pinctrl/sh-pfc/core.c Laurent Pinchart 2013-07-15  129  static int sh_pfc_enum_in_range(u16 enum_id, const struct pinmux_range *r)
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08  130  {
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08 @131  	if (enum_id < r->begin)
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08  132  		return 0;
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08  133  
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08  134  	if (enum_id > r->end)
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08  135  		return 0;
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08  136  
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08  137  	return 1;
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08  138  }
2967dab1ae37e3 arch/sh/kernel/gpio.c         Magnus Damm      2008-10-08  139  

:::::: The code at line 131 was first introduced by commit
:::::: 2967dab1ae37e30f1b71316513b49fd25c42eabe sh: GPIO and pinmux base code

:::::: TO: Magnus Damm <damm@igel.co.jp>
:::::: CC: Paul Mundt <lethal@linux-sh.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

             reply	other threads:[~2021-07-20 19:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 19:56 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-09  0:43 drivers/pinctrl/renesas/core.c:131:16: warning: Possible null pointer dereference: r [nullPointer] kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107210334.xdJsJNC9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.