CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Pratyush Yadav <[email protected]>
CC: Vignesh Raghavendra <[email protected]>
CC: Tudor Ambarus <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   c7d102232649226a69dddd58a4942cf13cff4f7c
commit: 0e30f47232ab57c685258aa91adc3a3e67bd023e mtd: spi-nor: add support for 
DTR protocol
date:   9 months ago
:::::: branch date: 2 days ago
:::::: commit date: 9 months ago
config: x86_64-randconfig-c001-20210731 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 
4f71f59bf3d9914188a11d0c41bedbb339d36ff5)
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/torvalds/linux.git/commit/?id=0e30f47232ab57c685258aa91adc3a3e67bd023e
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 0e30f47232ab57c685258aa91adc3a3e67bd023e
        # 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 <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
                      ^~~~~~
   net/9p/trans_virtio.c:423:9: note: Taking true branch
           } else if (uidata) {
                  ^
   net/9p/trans_virtio.c:424:11: note: Calling 'p9_get_mapped_pages'
                   int n = p9_get_mapped_pages(chan, &in_pages, uidata,
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/9p/trans_virtio.c:314:6: note: Assuming the condition is true
           if (!iov_iter_count(data))
               ^~~~~~~~~~~~~~~~~~~~~
   net/9p/trans_virtio.c:314:2: note: Taking true branch
           if (!iov_iter_count(data))
           ^
   net/9p/trans_virtio.c:315:3: note: Returning without writing to '*offs'
                   return 0;
                   ^
   net/9p/trans_virtio.c:424:11: note: Returning from 'p9_get_mapped_pages'
                   int n = p9_get_mapped_pages(chan, &in_pages, uidata,
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/9p/trans_virtio.c:426:7: note: 'n' is >= 0
                   if (n < 0) {
                       ^
   net/9p/trans_virtio.c:426:3: note: Taking false branch
                   if (n < 0) {
                   ^
   net/9p/trans_virtio.c:430:32: note: The right operand of '+' is a garbage 
value
                   in_nr_pages = DIV_ROUND_UP(n + offs, PAGE_SIZE);
                                                ^
   include/linux/kernel.h:85:22: note: expanded from macro 'DIV_ROUND_UP'
   #define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP
                        ^
   include/uapi/linux/kernel.h:13:40: note: expanded from macro 
'__KERNEL_DIV_ROUND_UP'
   #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
                                          ^
   net/9p/trans_virtio.c:470:3: warning: Value stored to 'in' is never read 
[clang-analyzer-deadcode.DeadStores]
                   in += pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/9p/trans_virtio.c:470:3: note: Value stored to 'in' is never read
                   in += pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   drivers/mtd/nand/spi/gigadevice.c:191:14: warning: The left operand of '&' 
is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                           ((status2 & STATUS_ECC_MASK) >> 4);
                             ~~~~~~~ ^
   drivers/mtd/nand/spi/gigadevice.c:167:2: note: 'status2' declared without an 
initial value
           u8 status2;
           ^~~~~~~~~~
   drivers/mtd/nand/spi/gigadevice.c:172:2: note: Control jumps to 'case 16:'  
at line 176
           switch (status & STATUS_ECC_MASK) {
           ^
   drivers/mtd/nand/spi/gigadevice.c:182:7: note: Assuming 'ret' is 0
                   if (ret)
                       ^~~
   drivers/mtd/nand/spi/gigadevice.c:182:3: note: Taking false branch
                   if (ret)
                   ^
   drivers/mtd/nand/spi/gigadevice.c:191:14: note: The left operand of '&' is a 
garbage value
                           ((status2 & STATUS_ECC_MASK) >> 4);
                             ~~~~~~~ ^
   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.
   drivers/mtd/nand/spi/macronix.c:63:9: warning: The left expression of the 
compound assignment is an uninitialized value. The computed value will also be 
garbage [clang-analyzer-core.uninitialized.Assign]
           *eccsr &= MACRONIX_ECCSR_MASK;
                  ^
   drivers/mtd/nand/spi/macronix.c:71:2: note: 'eccsr' declared without an 
initial value
           u8 eccsr;
           ^~~~~~~~
   drivers/mtd/nand/spi/macronix.c:73:2: note: Control jumps to 'case 16:'  at 
line 80
           switch (status & STATUS_ECC_MASK) {
           ^
   drivers/mtd/nand/spi/macronix.c:86:7: note: Calling 'mx35lf1ge4ab_get_eccsr'
                   if (mx35lf1ge4ab_get_eccsr(spinand, &eccsr))
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/mtd/nand/spi/macronix.c:60:6: note: Assuming 'ret' is 0
           if (ret)
               ^~~
   drivers/mtd/nand/spi/macronix.c:60:2: note: Taking false branch
           if (ret)
           ^
   drivers/mtd/nand/spi/macronix.c:63:9: note: The left expression of the 
compound assignment is an uninitialized value. The computed value will also be 
garbage
           *eccsr &= MACRONIX_ECCSR_MASK;
           ~~~~~~ ^
   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.
   5 warnings generated.
>> drivers/mtd/spi-nor/core.c:1452:2: warning: Use of memory after it is freed 
>> [clang-analyzer-unix.Malloc]
           list_for_each_entry_safe(cmd, next, erase_list, list) {
           ^
   include/linux/list.h:716:7: note: expanded from macro 
'list_for_each_entry_safe'
                   n = list_next_entry(pos, member);                       \
                       ^
   include/linux/list.h:555:2: note: expanded from macro 'list_next_entry'
           list_entry((pos)->member.next, typeof(*(pos)), member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:852:25: note: expanded from macro 'container_of'
           void *__mptr = (void *)(ptr);                                   \
                                  ^
   drivers/mtd/spi-nor/core.c:1544:6: note: 'ret' is 0
           if (ret)
               ^~~
   drivers/mtd/spi-nor/core.c:1544:2: note: Taking false branch
           if (ret)
           ^
   drivers/mtd/spi-nor/core.c:1547:2: note: Left side of '&&' is false
           list_for_each_entry_safe(cmd, next, &erase_list, list) {
           ^
   include/linux/list.h:715:13: note: expanded from macro 
'list_for_each_entry_safe'
           for (pos = list_first_entry(head, typeof(*pos), member),        \
                      ^
   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) &&   \
                                                                      ^
   drivers/mtd/spi-nor/core.c:1547:2: note: Taking false branch
           list_for_each_entry_safe(cmd, next, &erase_list, list) {
           ^
   include/linux/list.h:715:13: note: expanded from macro 
'list_for_each_entry_safe'
           for (pos = list_first_entry(head, typeof(*pos), member),        \
                      ^
   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)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to 
see all)
   include/linux/compiler_types.h:319:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:299:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/mtd/spi-nor/core.c:1547:2: note: Loop condition is false.  Exiting 
loop
           list_for_each_entry_safe(cmd, next, &erase_list, list) {
           ^
   include/linux/list.h:715:13: note: expanded from macro 
'list_for_each_entry_safe'
           for (pos = list_first_entry(head, typeof(*pos), member),        \
                      ^
   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)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to 
see all)
   include/linux/compiler_types.h:319:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:297:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   drivers/mtd/spi-nor/core.c:1547:2: note: Left side of '&&' is false
           list_for_each_entry_safe(cmd, next, &erase_list, list) {
           ^
   include/linux/list.h:716:7: note: expanded from macro 
'list_for_each_entry_safe'
                   n = list_next_entry(pos, member);                       \
                       ^
   include/linux/list.h:555:2: note: expanded from macro 'list_next_entry'
           list_entry((pos)->member.next, typeof(*(pos)), 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) &&   \
                                                                      ^
   drivers/mtd/spi-nor/core.c:1547:2: note: Taking false branch
           list_for_each_entry_safe(cmd, next, &erase_list, list) {
           ^
   include/linux/list.h:716:7: note: expanded from macro 
'list_for_each_entry_safe'
                   n = list_next_entry(pos, member);                       \
                       ^

vim +1452 drivers/mtd/spi-nor/core.c

5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1443  
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1444  /**
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1445   * 
spi_nor_destroy_erase_cmd_list() - destroy erase command list
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1446   * 
@erase_list:    list of erase commands
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1447   */
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1448  
static void spi_nor_destroy_erase_cmd_list(struct list_head *erase_list)
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1449  {
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1450     
struct spi_nor_erase_command *cmd, *next;
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1451  
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 @1452     
list_for_each_entry_safe(cmd, next, erase_list, list) {
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1453     
        list_del(&cmd->list);
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1454     
        kfree(cmd);
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1455     
}
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1456  }
5390a8df769ec9 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11  1457  

:::::: The code at line 1452 was first introduced by commit
:::::: 5390a8df769ec9ba9c995191bb0867430f602ebb mtd: spi-nor: add support to 
non-uniform SFDP SPI NOR flash memories

:::::: TO: Tudor Ambarus <[email protected]>
:::::: CC: Boris Brezillon <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to