[kbuild] [bcache:nvdimm-meta 11/12] drivers/md/bcache/journal.c:123:27: warning: Access to field 'keys' results in a dereference of an undefined pointer value (loaded from variable 'j') [clang-analyze

2021-08-26 Thread kernel test robot
CC: clang-built-li...@googlegroups.com
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Coly Li 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git 
nvdimm-meta
head:   80de5dc2a60df7adc4cdd2ed063dae948a93e089
commit: ab89b985340028f590e633e9095b3c6255a74fc2 [11/12] bcache: read jset from 
NVDIMM pages for journal replay
:: branch date: 8 days ago
:: commit date: 8 days ago
config: riscv-randconfig-c006-20210825 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
ea08c4cd1c0869ec5024a8bb3f5cdf06ab03ae83)
reproduce (this is a W=1 build):
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# 
https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git/commit/?id=ab89b985340028f590e633e9095b3c6255a74fc2
git remote add bcache 
https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git
git fetch --no-tags bcache nvdimm-meta
git checkout ab89b985340028f590e633e9095b3c6255a74fc2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 


clang-analyzer warnings: (new ones prefixed by >>)
   can_skb_prv(skb)->skbcnt = 0;
   ^~~~
   net/can/raw.c:820:24: note: Value assigned to field 'end'
   err = memcpy_from_msg(skb_put(skb, size), msg, size);
 ^~
   net/can/raw.c:821:6: note: 'err' is >= 0
   if (err < 0)
   ^~~
   net/can/raw.c:821:2: note: Taking false branch
   if (err < 0)
   ^
   net/can/raw.c:824:2: note: Calling 'skb_setup_tx_timestamp'
   skb_setup_tx_timestamp(skb, sk->sk_tsflags);
   ^~~
   include/net/sock.h:2561:39: note: Passing value via 3rd parameter 'tx_flags'
   _sock_tx_timestamp(skb->sk, tsflags, _shinfo(skb)->tx_flags,
^~
   include/net/sock.h:2561:2: note: Calling '_sock_tx_timestamp'
   _sock_tx_timestamp(skb->sk, tsflags, _shinfo(skb)->tx_flags,
   ^~~~
   include/net/sock.h:2543:6: note: Assuming 'tsflags' is not equal to 0
   if (unlikely(tsflags)) {
   ^
   include/linux/compiler.h:48:24: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
^~~
   include/linux/compiler.h:33:32: note: expanded from macro '__branch_check__'
   __r = __builtin_expect(!!(x), expect);  \
   ^~~~
   include/net/sock.h:2543:2: note: Taking true branch
   if (unlikely(tsflags)) {
   ^
   include/net/sock.h:2545:7: note: Assuming the condition is true
   if (tsflags & SOF_TIMESTAMPING_OPT_ID && tskey &&
   ^
   include/net/sock.h:2545:7: note: Left side of '&&' is true
   include/net/sock.h:2545:44: note: Assuming 'tskey' is null
   if (tsflags & SOF_TIMESTAMPING_OPT_ID && tskey &&
^
   include/net/sock.h:2545:7: note: Assuming pointer value is null
   if (tsflags & SOF_TIMESTAMPING_OPT_ID && tskey &&
   ^~
   include/net/sock.h:2545:50: note: Left side of '&&' is false
   if (tsflags & SOF_TIMESTAMPING_OPT_ID && tskey &&
  ^
   include/net/sock.h:2549:6: note: Assuming the condition is false
   if (unlikely(sock_flag(sk, SOCK_WIFI_STATUS)))
   ^
   include/linux/compiler.h:48:24: note: expanded from macro 'unlikely'
   #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
^~~
   include/linux/compiler.h:33:32: note: expanded from macro '__branch_check__'
   __r = __builtin_expect(!!(x), expect);  \
   ^~~~
   include/net/sock.h:2549:2: note: Taking true branch
   if (unlikely(sock_flag(sk, SOCK_WIFI_STATUS)))
   ^
   include/net/sock.h:2550:13: note: Dereference of null pointer (loaded from 
variable 'tx_flags')
   *tx_flags |= SKBTX_WIFI_STATUS;
 ^
   

[kbuild] [bcache:nvdimm-meta 11/12] drivers/md/bcache/journal.c:123:27: warning: Access to field 'keys' results in a dereference of an undefined pointer value (loaded from variable 'j') [clang-analyze

2021-08-14 Thread kernel test robot
CC: clang-built-li...@googlegroups.com
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: Coly Li 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git 
nvdimm-meta
head:   8479d552442398498ffcf15d551ff22a63b799e3
commit: f2800a148cb8ca81162d7c898f058df2e230b1e2 [11/12] bcache: read jset from 
NVDIMM pages for journal replay
:: branch date: 3 days ago
:: commit date: 3 days ago
config: x86_64-randconfig-c001-20210811 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
d39ebdae674c8efc84ebe8dc32716ec353220530)
reproduce (this is a W=1 build):
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# 
https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git/commit/?id=f2800a148cb8ca81162d7c898f058df2e230b1e2
git remote add bcache 
https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git
git fetch --no-tags bcache nvdimm-meta
git checkout f2800a148cb8ca81162d7c898f058df2e230b1e2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 


clang-analyzer warnings: (new ones prefixed by >>)
   drivers/nvme/host/fc.c:3794:11: note: Loop condition is false.  Exiting loop
   rport = list_first_entry(_disc_list,
   ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
   list_entry((ptr)->next, type, member)
   ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
   container_of(ptr, type, member)
   ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
   BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
   ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to 
see all)
   include/linux/compiler_types.h:328:2: note: expanded from macro 
'compiletime_assert'
   _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
   ^
   include/linux/compiler_types.h:316:2: note: expanded from macro 
'_compiletime_assert'
   __compiletime_assert(condition, msg, prefix, suffix)
   ^
   include/linux/compiler_types.h:306:2: note: expanded from macro 
'__compiletime_assert'
   do {\
   ^
   drivers/nvme/host/fc.c:3796:3: note: Calling 'list_del_init'
   list_del_init(>disc_list);
   ^~~~
   include/linux/list.h:204:2: note: Calling '__list_del_entry'
   __list_del_entry(entry);
   ^~~
   include/linux/list.h:132:6: note: Assuming the condition is false
   if (!__list_del_entry_valid(entry))
   ^~
   include/linux/list.h:132:2: note: Taking false branch
   if (!__list_del_entry_valid(entry))
   ^
   include/linux/list.h:135:13: note: Use of memory after it is freed
   __list_del(entry->prev, entry->next);
  ^~~
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3