[mkl-can-next:testing 45/46] drivers/net/can/flexcan.c:666:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




tree: https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git testing
head:   8dad5561c13ade87238d9de6dd410b43f7562447
commit: d9cead75b1c66b4660b4f87ff339234042d7c6a5 [45/46] can: flexcan: add mcf5441x support
config: x86_64-randconfig-c001-20210726 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c63dbd850182797bc4b76124d08e1c320ab2365d)
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/mkl/linux-can-next.git/commit/?id=d9cead75b1c66b4660b4f87ff339234042d7c6a5 git remote add mkl-can-next https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
        git fetch --no-tags mkl-can-next testing
        git checkout d9cead75b1c66b4660b4f87ff339234042d7c6a5
        # 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 <lkp@xxxxxxxxx>


clang-analyzer warnings: (new ones prefixed by >>)
   8 warnings generated.
drivers/staging/ks7010/ks_hostif.c:895:2: warning: Value stored to 'pbuf' is never read [clang-analyzer-deadcode.DeadStores]
           pbuf += sprintf(pbuf, ")");
           ^       ~~~~~~~~~~~~~~~~~~
drivers/staging/ks7010/ks_hostif.c:895:2: note: Value stored to 'pbuf' is never read
           pbuf += sprintf(pbuf, ")");
           ^       ~~~~~~~~~~~~~~~~~~
drivers/staging/ks7010/ks_hostif.c:1178:5: warning: Value stored to 'length' is never read [clang-analyzer-deadcode.DeadStores]
                                   length += sizeof(mic);
                                   ^         ~~~~~~~~~~~
drivers/staging/ks7010/ks_hostif.c:1178:5: note: Value stored to 'length' is never read
                                   length += sizeof(mic);
                                   ^         ~~~~~~~~~~~
drivers/staging/ks7010/ks_hostif.c:1180:5: warning: Value stored to 'p' is never read [clang-analyzer-deadcode.DeadStores]
                                   p += sizeof(mic);
                                   ^    ~~~~~~~~~~~
drivers/staging/ks7010/ks_hostif.c:1180:5: note: Value stored to 'p' is never read
                                   p += sizeof(mic);
                                   ^    ~~~~~~~~~~~
   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.
   6 warnings generated.
drivers/staging/ks7010/ks_wlan_net.c:1811:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(extra, priv->firmware_version);
           ^~~~~~
drivers/staging/ks7010/ks_wlan_net.c:1811:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(extra, priv->firmware_version);
           ^~~~~~
   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.
   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.
fs/splice.c:725:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
           return ret;
           ^      ~~~
   fs/splice.c:630:2: note: 'ret' declared without an initial value
           ssize_t ret;
           ^~~~~~~~~~~
   fs/splice.c:632:15: note: Assuming 'array' is non-null
           if (unlikely(!array))
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   fs/splice.c:632:2: note: Taking false branch
           if (unlikely(!array))
           ^
fs/splice.c:638:2: note: Loop condition is false. Execution continues on line 717
           while (sd.total_len) {
           ^
   fs/splice.c:722:9: note: Field 'num_spliced' is 0
           if (sd.num_spliced)
                  ^
   fs/splice.c:722:2: note: Taking false branch
           if (sd.num_spliced)
           ^
   fs/splice.c:725:2: note: Undefined or garbage value returned to caller
           return ret;
           ^      ~~~
fs/splice.c:853:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = 0;
           ^     ~
   fs/splice.c:853:2: note: Value stored to 'ret' is never read
           ret = 0;
           ^     ~
   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.
   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.
   4 warnings generated.
drivers/tty/serial/8250/8250_pci.c:1302:9: warning: Although the value stored to 'tmp' is used in the enclosing expression, the value is never actually read from 'tmp' [clang-analyzer-deadcode.DeadStores]
                           outl(tmp &= ~0x01000000, base + 0x3c);
                                ^      ~~~~~~~~~~~
drivers/tty/serial/8250/8250_pci.c:1302:9: note: Although the value stored to 'tmp' is used in the enclosing expression, the value is never actually read from 'tmp'
                           outl(tmp &= ~0x01000000, base + 0x3c);
                                ^      ~~~~~~~~~~~
   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/net/can/flexcan.c:666:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
           return err;
           ^
   drivers/net/can/flexcan.c:2356:9: note: Calling 'flexcan_clks_enable'
           return flexcan_clks_enable(priv);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/can/flexcan.c:652:2: note: 'err' declared without an initial value
           int err;
           ^~~~~~~
   drivers/net/can/flexcan.c:654:6: note: Assuming field 'clk_ipg' is null
           if (priv->clk_ipg) {
               ^~~~~~~~~~~~~
   drivers/net/can/flexcan.c:654:2: note: Taking false branch
           if (priv->clk_ipg) {
           ^
   drivers/net/can/flexcan.c:660:6: note: Assuming field 'clk_per' is null
           if (priv->clk_per) {
               ^~~~~~~~~~~~~
   drivers/net/can/flexcan.c:660:2: note: Taking false branch
           if (priv->clk_per) {
           ^
drivers/net/can/flexcan.c:666:2: note: Undefined or garbage value returned to caller
           return err;
           ^      ~~~
   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.
   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.
drivers/net/can/m_can/m_can.c:1166:4: warning: Value stored to 'reg_btp' is never read [clang-analyzer-deadcode.DeadStores]
                           reg_btp |= DBTP_TDC;
                           ^
drivers/net/can/m_can/m_can.c:1166:4: note: Value stored to 'reg_btp' is never read
   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.
   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.
   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.
   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.
   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.
   4 warnings generated.
sound/soc/intel/atom/sst/sst_acpi.c:315:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(ctx->firmware_name, mach->fw_filename);
           ^~~~~~
sound/soc/intel/atom/sst/sst_acpi.c:315:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(ctx->firmware_name, mach->fw_filename);
           ^~~~~~
   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.
   7 warnings generated.
drivers/mtd/chips/cfi_cmdset_0002.c:1791:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                           ret = 0;
                           ^     ~
drivers/mtd/chips/cfi_cmdset_0002.c:1791:4: note: Value stored to 'ret' is never read
                           ret = 0;
                           ^     ~
drivers/mtd/chips/cfi_cmdset_0002.c:2422:16: warning: Value stored to 'timeo' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long timeo = jiffies + HZ;
                         ^~~~~   ~~~~~~~~~~~~
drivers/mtd/chips/cfi_cmdset_0002.c:2422:16: note: Value stored to 'timeo' during its initialization is never read
           unsigned long timeo = jiffies + HZ;
                         ^~~~~   ~~~~~~~~~~~~
drivers/mtd/chips/cfi_cmdset_0002.c:2522:16: warning: Value stored to 'timeo' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           unsigned long timeo = jiffies + HZ;
                         ^~~~~   ~~~~~~~~~~~~
drivers/mtd/chips/cfi_cmdset_0002.c:2522:16: note: Value stored to 'timeo' during its initialization is never read
           unsigned long timeo = jiffies + HZ;
                         ^~~~~   ~~~~~~~~~~~~
   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.
   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.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).

vim +666 drivers/net/can/flexcan.c

da49a8075c00b4 ZHU Yi (ST-FIR/ENG1-Zhu 2017-09-15 649) ca10989632d882 Aisheng Dong 2018-11-30 650 static int flexcan_clks_enable(const struct flexcan_priv *priv)
ca10989632d882 Aisheng Dong             2018-11-30  651  {
ca10989632d882 Aisheng Dong             2018-11-30  652  	int err;
ca10989632d882 Aisheng Dong 2018-11-30 653 d9cead75b1c66b Angelo Dureghello 2021-07-02 654 if (priv->clk_ipg) { ca10989632d882 Aisheng Dong 2018-11-30 655 err = clk_prepare_enable(priv->clk_ipg);
ca10989632d882 Aisheng Dong             2018-11-30  656  		if (err)
ca10989632d882 Aisheng Dong             2018-11-30  657  			return err;
d9cead75b1c66b Angelo Dureghello        2021-07-02  658  	}
ca10989632d882 Aisheng Dong 2018-11-30 659 d9cead75b1c66b Angelo Dureghello 2021-07-02 660 if (priv->clk_per) { ca10989632d882 Aisheng Dong 2018-11-30 661 err = clk_prepare_enable(priv->clk_per);
ca10989632d882 Aisheng Dong             2018-11-30  662  		if (err)
ca10989632d882 Aisheng Dong 2018-11-30 663 clk_disable_unprepare(priv->clk_ipg);
d9cead75b1c66b Angelo Dureghello        2021-07-02  664  	}
ca10989632d882 Aisheng Dong 2018-11-30 665 ca10989632d882 Aisheng Dong 2018-11-30 @666 return err;
ca10989632d882 Aisheng Dong             2018-11-30  667  }
ca10989632d882 Aisheng Dong             2018-11-30  668
:::::: The code at line 666 was first introduced by commit
:::::: ca10989632d8820749fad37e13843750198e450a can: flexcan: implement can Runtime PM

:::::: TO: Aisheng Dong <aisheng.dong@xxxxxxx>
:::::: CC: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- kbuild@xxxxxxxxxxxx
To unsubscribe send an email to kbuild-leave@xxxxxxxxxxxx


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux