From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: include/linux/sunrpc/svc_rdma_pcl.h:64:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
Date: Mon, 29 Nov 2021 10:35:52 +0800 [thread overview]
Message-ID: <202111291024.H7MLdYci-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 15457 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Chuck Lever <chuck.lever@oracle.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d58071a8a76d779eedab38033ae4c821c30295a5
commit: 78147ca8b4a9b6cf0e597ddd6bf17959e08376c2 svcrdma: Add a "parsed chunk list" data structure
date: 12 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 12 months ago
config: x86_64-randconfig-c007-20211124 (https://download.01.org/0day-ci/archive/20211129/202111291024.H7MLdYci-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 67a1c45def8a75061203461ab0060c75c864df1c)
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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=78147ca8b4a9b6cf0e597ddd6bf17959e08376c2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 78147ca8b4a9b6cf0e597ddd6bf17959e08376c2
# save the config file 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 <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
4 warnings generated.
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 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.
6 warnings generated.
drivers/clk/clk-si5341.c:667:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = si5341_encode_44_32(synth->data->regmap,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/clk-si5341.c:667:2: note: Value stored to 'err' is never read
err = si5341_encode_44_32(synth->data->regmap,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/clk-si5341.c:827:23: warning: Division by zero [clang-analyzer-core.DivideZero]
rate = *parent_rate / (r << 1);
~~~~~~~~~~~~~^~~~~~~~~~
drivers/clk/clk-si5341.c:812:6: note: Assuming 'r' is 0
if (r && !(r % rate))
^
drivers/clk/clk-si5341.c:812:8: note: Left side of '&&' is false
if (r && !(r % rate))
^
drivers/clk/clk-si5341.c:815:6: note: Assuming the condition is false
if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/clk-si5341.c:815:2: note: Taking false branch
if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
^
drivers/clk/clk-si5341.c:827:23: note: Division by zero
rate = *parent_rate / (r << 1);
~~~~~~~~~~~~~^~~~~~~~~~
drivers/clk/clk-si5341.c:861:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = regmap_bulk_write(output->data->regmap,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/clk-si5341.c:861:2: note: Value stored to 'err' is never read
err = regmap_bulk_write(output->data->regmap,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
2 warnings generated.
Suppressed 2 warnings (2 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.
2 warnings generated.
Suppressed 2 warnings (2 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.
4 warnings generated.
drivers/dma/dmatest.c:939:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = kthread_stop(thread->task);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/dmatest.c:939:3: note: Value stored to 'ret' is never read
ret = kthread_stop(thread->task);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
4 warnings generated.
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.
4 warnings generated.
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.
5 warnings generated.
>> include/linux/sunrpc/svc_rdma_pcl.h:64:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
return list_first_entry(&pcl->cl_chunks, struct svc_rdma_chunk,
^
net/sunrpc/xprtrdma/svc_rdma_pcl.c:19:2: note: Loop condition is true. Entering loop body
while (!list_empty(&pcl->cl_chunks)) {
^
net/sunrpc/xprtrdma/svc_rdma_pcl.c:24:3: note: Memory is released
kfree(chunk);
^~~~~~~~~~~~
net/sunrpc/xprtrdma/svc_rdma_pcl.c:19:2: note: Loop condition is true. Entering loop body
while (!list_empty(&pcl->cl_chunks)) {
^
net/sunrpc/xprtrdma/svc_rdma_pcl.c:22:11: note: Calling 'pcl_first_chunk'
chunk = pcl_first_chunk(pcl);
^~~~~~~~~~~~~~~~~~~~
include/linux/sunrpc/svc_rdma_pcl.h:62:6: note: Assuming the condition is false
if (pcl_is_empty(pcl))
^~~~~~~~~~~~~~~~~
include/linux/sunrpc/svc_rdma_pcl.h:62:2: note: Taking false branch
if (pcl_is_empty(pcl))
^
include/linux/sunrpc/svc_rdma_pcl.h:64:9: note: Left side of '&&' is false
return list_first_entry(&pcl->cl_chunks, struct svc_rdma_chunk,
^
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:853:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/sunrpc/svc_rdma_pcl.h:64:9: note: Taking false branch
return list_first_entry(&pcl->cl_chunks, struct svc_rdma_chunk,
^
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:853: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:315:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:303:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:295:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
include/linux/sunrpc/svc_rdma_pcl.h:64:9: note: Loop condition is false. Exiting loop
return list_first_entry(&pcl->cl_chunks, struct svc_rdma_chunk,
^
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:853: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:315:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:303:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:293:2: note: expanded from macro '__compiletime_assert'
do { \
^
include/linux/sunrpc/svc_rdma_pcl.h:64:2: note: Use of memory after it is freed
return list_first_entry(&pcl->cl_chunks, struct svc_rdma_chunk,
^
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.
5 warnings generated.
Suppressed 5 warnings (5 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.
4 warnings generated.
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.
4 warnings generated.
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.
2 warnings generated.
Suppressed 2 warnings (2 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.
5 warnings generated.
Suppressed 5 warnings (5 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.
5 warnings generated.
Suppressed 5 warnings (5 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.
5 warnings generated.
vim +64 include/linux/sunrpc/svc_rdma_pcl.h
78147ca8b4a9b6 Chuck Lever 2020-06-22 52
78147ca8b4a9b6 Chuck Lever 2020-06-22 53 /**
78147ca8b4a9b6 Chuck Lever 2020-06-22 54 * pcl_first_chunk - Return first chunk in a parsed chunk list
78147ca8b4a9b6 Chuck Lever 2020-06-22 55 * @pcl: parsed chunk list
78147ca8b4a9b6 Chuck Lever 2020-06-22 56 *
78147ca8b4a9b6 Chuck Lever 2020-06-22 57 * Returns the first chunk in the list, or NULL if the list is empty.
78147ca8b4a9b6 Chuck Lever 2020-06-22 58 */
78147ca8b4a9b6 Chuck Lever 2020-06-22 59 static inline struct svc_rdma_chunk *
78147ca8b4a9b6 Chuck Lever 2020-06-22 60 pcl_first_chunk(const struct svc_rdma_pcl *pcl)
78147ca8b4a9b6 Chuck Lever 2020-06-22 61 {
78147ca8b4a9b6 Chuck Lever 2020-06-22 62 if (pcl_is_empty(pcl))
78147ca8b4a9b6 Chuck Lever 2020-06-22 63 return NULL;
78147ca8b4a9b6 Chuck Lever 2020-06-22 @64 return list_first_entry(&pcl->cl_chunks, struct svc_rdma_chunk,
78147ca8b4a9b6 Chuck Lever 2020-06-22 65 ch_list);
78147ca8b4a9b6 Chuck Lever 2020-06-22 66 }
78147ca8b4a9b6 Chuck Lever 2020-06-22 67
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2021-11-29 2:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-29 2:35 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-11-27 18:35 include/linux/sunrpc/svc_rdma_pcl.h:64:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc] 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=202111291024.H7MLdYci-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.