All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
@ 2022-01-19 20:13 kernel test robot
  2022-01-20  1:46   ` kernel test robot
  0 siblings, 1 reply; 13+ messages in thread
From: kernel test robot @ 2022-01-19 20:13 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nikita Shubin <nikita.shubin@maquefel.me>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Alexander Sverdlin <alexander.sverdlin@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1d1df41c5a33359a00e919d54eaebfb789711fdc
commit: 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert in-place to COMMON_CLK
date:   3 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 3 months ago
config: arm-randconfig-c002-20220118 (https://download.01.org/0day-ci/archive/20220120/202201200359.lTk9zHg4-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 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 >>)
                   ^
   security/integrity/ima/ima_api.c:73:4: note: Control jumps to line 81
                           goto out;
                           ^
   security/integrity/ima/ima_api.c:82:2: note: Null pointer value stored to 'entry'
           *entry = NULL;
           ^~~~~~~~~~~~~
   security/integrity/ima/ima_api.c:328:11: note: Returning from 'ima_alloc_init_template'
           result = ima_alloc_init_template(&event_data, &entry, template_desc);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/integrity/ima/ima_api.c:329:6: note: Assuming 'result' is >= 0
           if (result < 0) {
               ^~~~~~~~~~
   security/integrity/ima/ima_api.c:329:2: note: Taking false branch
           if (result < 0) {
           ^
   security/integrity/ima/ima_api.c:335:30: note: Passing null pointer value via 1st parameter 'entry'
           result = ima_store_template(entry, violation, inode, filename, pcr);
                                       ^~~~~
   security/integrity/ima/ima_api.c:335:11: note: Calling 'ima_store_template'
           result = ima_store_template(entry, violation, inode, filename, pcr);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/integrity/ima/ima_api.c:108:24: note: Access to field 'template_desc' results in a dereference of a null pointer (loaded from variable 'entry')
           char *template_name = entry->template_desc->name;
                                 ^~~~~
   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.
   8 warnings generated.
   drivers/bus/mhi/core/boot.c:28:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:28:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:121:3: warning: Value stored to 'ee' is never read [clang-analyzer-deadcode.DeadStores]
                   ee = mhi_get_exec_env(mhi_cntrl);
                   ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:121:3: note: Value stored to 'ee' is never read
                   ee = mhi_get_exec_env(mhi_cntrl);
                   ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:143:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = mhi_read_reg(mhi_cntrl, base, BHIE_RXVECSTATUS_OFFS, &rx_status);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:143:2: note: Value stored to 'ret' is never read
           ret = mhi_read_reg(mhi_cntrl, base, BHIE_RXVECSTATUS_OFFS, &rx_status);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:158:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:158:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:183:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/bus/mhi/core/boot.c:183:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = &mhi_cntrl->mhi_dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~~
   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/phy/phy-core.c:307:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = 0; /* Override possible ret == -ENOTSUPP */
           ^     ~
   drivers/phy/phy-core.c:307:2: note: Value stored to 'ret' is never read
           ret = 0; /* Override possible ret == -ENOTSUPP */
           ^     ~
   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.
   6 warnings generated.
   Suppressed 6 warnings (3 in non-user code, 3 with check filters).
   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.
   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 (4 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
>> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:579:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
           ^
   arch/arm/mach-ep93xx/clock.c:627:6: note: Assuming the condition is false
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:627:2: note: Taking false branch
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
           ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Loop condition is false.  Exiting loop
           pr_info("PLL1 running at %ld MHz, PLL2@%ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Loop condition is false.  Exiting loop
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:642:2: note: Calling 'ep93xx_uart_clock_init'
           ep93xx_uart_clock_init();
           ^~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:479:6: note: Assuming the condition is false
           if (value & EP93XX_SYSCON_PWRCNT_UARTBAUD)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:479:2: note: Taking false branch
           if (value & EP93XX_SYSCON_PWRCNT_UARTBAUD)
           ^
   arch/arm/mach-ep93xx/clock.c:487:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < ARRAY_SIZE(ep93xx_uarts); i++) {
           ^
   arch/arm/mach-ep93xx/clock.c:488:8: note: Calling 'ep93xx_clk_register_gate'
                   hw = ep93xx_clk_register_gate(ep93xx_uarts[i].dev_id,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:136:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:136:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:142:23: note: 'parent_name' is non-null
           init.parent_names = (parent_name ? &parent_name : NULL);
                                ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:142:23: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:143:22: note: 'parent_name' is non-null
           init.num_parents = (parent_name ? 1 : 0);
                               ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:143:22: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:349:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:686:7: note: Calling 'clk_hw_register_ddiv'
           hw = clk_hw_register_ddiv("ep93xx-fb",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:331:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:331:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:346:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:347:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:349:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:456:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:579:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
           ^
   arch/arm/mach-ep93xx/clock.c:627:6: note: Assuming the condition is false
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:627:2: note: Taking false branch
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
           ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Loop condition is false.  Exiting loop
           pr_info("PLL1 running at %ld MHz, PLL2@%ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Loop condition is false.  Exiting loop
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:645:7: note: Calling 'clk_hw_register_div'
           hw = clk_hw_register_div("ep93xx-adc",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:434:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:434:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:440:23: note: 'parent_name' is non-null
           init.parent_names = (parent_name ? &parent_name : NULL);
                                ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:440:23: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:453:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:454:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:456:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
>> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:484:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   4 warnings generated.
   lib/mpi/mpi-pow.c:164:10: warning: The result of the left shift is undefined due to shifting by '32', which is greater or equal to the width of type 'mpi_limb_t' [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   e = (e << c) << 1;      /* shift the exp bits to the left, lose msb */
                          ^  ~
   lib/mpi/mpi-pow.c:49:6: note: Assuming 'msize' is not equal to 0
           if (!msize)
               ^~~~~~
   lib/mpi/mpi-pow.c:49:2: note: Taking false branch
           if (!msize)
           ^
   lib/mpi/mpi-pow.c:52:6: note: Assuming 'esize' is not equal to 0
           if (!esize) {
               ^~~~~~
   lib/mpi/mpi-pow.c:52:2: note: Taking false branch
           if (!esize) {
           ^
   lib/mpi/mpi-pow.c:71:6: note: Assuming 'mp' is non-null
           if (!mp)
               ^~~
   lib/mpi/mpi-pow.c:71:2: note: Taking false branch
           if (!mp)
           ^
   lib/mpi/mpi-pow.c:74:6: note: 'mod_shift_cnt' is 32
           if (mod_shift_cnt)
               ^~~~~~~~~~~~~
   lib/mpi/mpi-pow.c:74:2: note: Taking true branch
           if (mod_shift_cnt)
           ^
   lib/mpi/mpi-pow.c:81:6: note: Assuming 'bsize' is <= 'msize'
           if (bsize > msize) {    /* The base is larger than the module. Reduce it. */
               ^~~~~~~~~~~~~
   lib/mpi/mpi-pow.c:81:2: note: Taking false branch
           if (bsize > msize) {    /* The base is larger than the module. Reduce it. */
           ^
   lib/mpi/mpi-pow.c:98:6: note: Assuming 'bsize' is not equal to 0
           if (!bsize) {
               ^~~~~~
   lib/mpi/mpi-pow.c:98:2: note: Taking false branch
           if (!bsize) {
           ^
   lib/mpi/mpi-pow.c:104:6: note: Assuming 'size' is > field 'alloced'
           if (res->alloced < size) {
               ^~~~~~~~~~~~~~~~~~~
   lib/mpi/mpi-pow.c:104:2: note: Taking true branch
           if (res->alloced < size) {
           ^
   lib/mpi/mpi-pow.c:108:7: note: Assuming 'rp' is not equal to 'ep'
                   if (rp == ep || rp == mp || rp == bp) {
                       ^~~~~~~~
   lib/mpi/mpi-pow.c:108:7: note: Left side of '||' is false
   lib/mpi/mpi-pow.c:108:19: note: Assuming 'rp' is not equal to 'mp'
                   if (rp == ep || rp == mp || rp == bp) {
                                   ^~~~~~~~
   lib/mpi/mpi-pow.c:108:7: note: Left side of '||' is false
                   if (rp == ep || rp == mp || rp == bp) {
                       ^
   lib/mpi/mpi-pow.c:108:31: note: Assuming 'rp' is not equal to 'bp'
                   if (rp == ep || rp == mp || rp == bp) {
                                               ^~~~~~~~
   lib/mpi/mpi-pow.c:108:3: note: Taking false branch
                   if (rp == ep || rp == mp || rp == bp) {
                   ^
   lib/mpi/mpi-pow.c:114:8: note: Assuming the condition is false
                           if (mpi_resize(res, size) < 0)
                               ^~~~~~~~~~~~~~~~~~~~~~~~~
   lib/mpi/mpi-pow.c:114:4: note: Taking false branch
                           if (mpi_resize(res, size) < 0)
                           ^
   lib/mpi/mpi-pow.c:144:2: note: Assuming '_i' is >= 'bsize'
           MPN_COPY(rp, bp, bsize);
           ^
   lib/mpi/mpi-internal.h:65:16: note: expanded from macro 'MPN_COPY'
                   for (_i = 0; _i < (n); _i++)    \
                                ^~~~~~~~
   lib/mpi/mpi-pow.c:144:2: note: Loop condition is false. Execution continues on line 144
           MPN_COPY(rp, bp, bsize);
           ^
   lib/mpi/mpi-internal.h:65:3: note: expanded from macro 'MPN_COPY'
                   for (_i = 0; _i < (n); _i++)    \
                   ^
   lib/mpi/mpi-pow.c:144:2: note: Loop condition is false.  Exiting loop
           MPN_COPY(rp, bp, bsize);
           ^
   lib/mpi/mpi-internal.h:63:2: note: expanded from macro 'MPN_COPY'

vim +154 arch/arm/mach-ep93xx/clock.c

ff05c0330b9880 Hartley Sweeten 2009-05-07  125  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct clk_hw *ep93xx_clk_register_gate(const char *name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  127  				    const char *parent_name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  128  				    void __iomem *reg,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  129  				    u8 bit_idx)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  130  {
9645ccc7bd7a16 Nikita Shubin   2021-10-18  131  	struct clk_init_data init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  132  	struct clk_psc *psc;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  133  	struct clk *clk;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  134  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  135  	psc = kzalloc(sizeof(*psc), GFP_KERNEL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  136  	if (!psc)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  137  		return ERR_PTR(-ENOMEM);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  138  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  139  	init.name = name;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  140  	init.ops = &clk_ep93xx_gate_ops;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  141  	init.flags = CLK_SET_RATE_PARENT;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  142  	init.parent_names = (parent_name ? &parent_name : NULL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  143  	init.num_parents = (parent_name ? 1 : 0);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  144  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  145  	psc->reg = reg;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  146  	psc->bit_idx = bit_idx;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  147  	psc->hw.init = &init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  148  	psc->lock = &clk_lock;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  149  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  150  	clk = clk_register(NULL, &psc->hw);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  151  	if (IS_ERR(clk))
9645ccc7bd7a16 Nikita Shubin   2021-10-18  152  		kfree(psc);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  153  
9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154  	return &psc->hw;
ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
ff05c0330b9880 Hartley Sweeten 2009-05-07  156  

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
  2022-01-19 20:13 arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc] kernel test robot
@ 2022-01-20  1:46   ` kernel test robot
  0 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2022-01-20  1:46 UTC (permalink / raw)
  To: Nikita Shubin
  Cc: llvm, kbuild-all, Linux Kernel Mailing List, Arnd Bergmann,
	Alexander Sverdlin

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1d1df41c5a33359a00e919d54eaebfb789711fdc
commit: 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert in-place to COMMON_CLK
date:   3 months ago
config: arm-randconfig-c002-20220118 (https://download.01.org/0day-ci/archive/20220120/202201200359.lTk9zHg4-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
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 arm cross compiling tool for clang build
         # apt-get install binutils-arm-linux-gnueabi
         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
         git fetch --no-tags linus master
         git checkout 9645ccc7bd7a16cd73c3be9dee70cd702b03be37
         # save the config file to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 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 >>)

 >> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
            return &psc->hw;
            ^
    arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
            if (IS_ERR(clk))
            ^
    arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
                    kfree(psc);
                    ^~~~~~~~~~
    arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after it is freed
            return &psc->hw;
            ^      ~~~~~~~~
 >> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
            hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
            ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 >> arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
            hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
            ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +154 arch/arm/mach-ep93xx/clock.c

ff05c0330b9880 Hartley Sweeten 2009-05-07  125
9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct clk_hw *ep93xx_clk_register_gate(const char *name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  127  				    const char *parent_name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  128  				    void __iomem *reg,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  129  				    u8 bit_idx)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  130  {
9645ccc7bd7a16 Nikita Shubin   2021-10-18  131  	struct clk_init_data init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  132  	struct clk_psc *psc;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  133  	struct clk *clk;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  134
9645ccc7bd7a16 Nikita Shubin   2021-10-18  135  	psc = kzalloc(sizeof(*psc), GFP_KERNEL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  136  	if (!psc)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  137  		return ERR_PTR(-ENOMEM);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  138
9645ccc7bd7a16 Nikita Shubin   2021-10-18  139  	init.name = name;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  140  	init.ops = &clk_ep93xx_gate_ops;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  141  	init.flags = CLK_SET_RATE_PARENT;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  142  	init.parent_names = (parent_name ? &parent_name : NULL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  143  	init.num_parents = (parent_name ? 1 : 0);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  144
9645ccc7bd7a16 Nikita Shubin   2021-10-18  145  	psc->reg = reg;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  146  	psc->bit_idx = bit_idx;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  147  	psc->hw.init = &init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  148  	psc->lock = &clk_lock;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  149
9645ccc7bd7a16 Nikita Shubin   2021-10-18  150  	clk = clk_register(NULL, &psc->hw);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  151  	if (IS_ERR(clk))
9645ccc7bd7a16 Nikita Shubin   2021-10-18  152  		kfree(psc);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  153
9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154  	return &psc->hw;
ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
ff05c0330b9880 Hartley Sweeten 2009-05-07  156

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
@ 2022-01-20  1:46   ` kernel test robot
  0 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2022-01-20  1:46 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1d1df41c5a33359a00e919d54eaebfb789711fdc
commit: 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert in-place to COMMON_CLK
date:   3 months ago
config: arm-randconfig-c002-20220118 (https://download.01.org/0day-ci/archive/20220120/202201200359.lTk9zHg4-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
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 arm cross compiling tool for clang build
         # apt-get install binutils-arm-linux-gnueabi
         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
         git fetch --no-tags linus master
         git checkout 9645ccc7bd7a16cd73c3be9dee70cd702b03be37
         # save the config file to linux build tree
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 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 >>)

 >> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
            return &psc->hw;
            ^
    arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
            if (IS_ERR(clk))
            ^
    arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
                    kfree(psc);
                    ^~~~~~~~~~
    arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after it is freed
            return &psc->hw;
            ^      ~~~~~~~~
 >> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
            hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
            ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 >> arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
            hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
            ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +154 arch/arm/mach-ep93xx/clock.c

ff05c0330b9880 Hartley Sweeten 2009-05-07  125
9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct clk_hw *ep93xx_clk_register_gate(const char *name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  127  				    const char *parent_name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  128  				    void __iomem *reg,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  129  				    u8 bit_idx)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  130  {
9645ccc7bd7a16 Nikita Shubin   2021-10-18  131  	struct clk_init_data init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  132  	struct clk_psc *psc;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  133  	struct clk *clk;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  134
9645ccc7bd7a16 Nikita Shubin   2021-10-18  135  	psc = kzalloc(sizeof(*psc), GFP_KERNEL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  136  	if (!psc)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  137  		return ERR_PTR(-ENOMEM);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  138
9645ccc7bd7a16 Nikita Shubin   2021-10-18  139  	init.name = name;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  140  	init.ops = &clk_ep93xx_gate_ops;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  141  	init.flags = CLK_SET_RATE_PARENT;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  142  	init.parent_names = (parent_name ? &parent_name : NULL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  143  	init.num_parents = (parent_name ? 1 : 0);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  144
9645ccc7bd7a16 Nikita Shubin   2021-10-18  145  	psc->reg = reg;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  146  	psc->bit_idx = bit_idx;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  147  	psc->hw.init = &init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  148  	psc->lock = &clk_lock;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  149
9645ccc7bd7a16 Nikita Shubin   2021-10-18  150  	clk = clk_register(NULL, &psc->hw);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  151  	if (IS_ERR(clk))
9645ccc7bd7a16 Nikita Shubin   2021-10-18  152  		kfree(psc);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  153
9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154  	return &psc->hw;
ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
ff05c0330b9880 Hartley Sweeten 2009-05-07  156

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
  2022-01-20  1:46   ` kernel test robot
@ 2022-01-24 21:50     ` Nick Desaulniers
  -1 siblings, 0 replies; 13+ messages in thread
From: Nick Desaulniers @ 2022-01-24 21:50 UTC (permalink / raw)
  To: Nikita Shubin
  Cc: llvm, kbuild-all, Linux Kernel Mailing List, Arnd Bergmann,
	Alexander Sverdlin, kernel test robot, Nathan Huckleberry,
	Philip Li

On Wed, Jan 19, 2022 at 5:46 PM kernel test robot <yujie.liu@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   1d1df41c5a33359a00e919d54eaebfb789711fdc
> commit: 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert in-place to COMMON_CLK
> date:   3 months ago
> config: arm-randconfig-c002-20220118 (https://download.01.org/0day-ci/archive/20220120/202201200359.lTk9zHg4-lkp@intel.com/config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
> 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 arm cross compiling tool for clang build
>          # apt-get install binutils-arm-linux-gnueabi
>          # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
>          git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>          git fetch --no-tags linus master
>          git checkout 9645ccc7bd7a16cd73c3be9dee70cd702b03be37
>          # save the config file to linux build tree
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer

Hey! This check finally caught something that looks legit! Cool to see
0day bot running clang-analyzer, too!
Nikita, can you PTAL?

>
> 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 >>)
>
>  >> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
>             return &psc->hw;
>             ^
>     arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
>             if (IS_ERR(clk))
>             ^
>     arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
>                     kfree(psc);
>                     ^~~~~~~~~~
>     arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after it is freed
>             return &psc->hw;
>             ^      ~~~~~~~~
>  >> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
>             hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
>             ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  >> arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
>             hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
>             ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> vim +154 arch/arm/mach-ep93xx/clock.c
>
> ff05c0330b9880 Hartley Sweeten 2009-05-07  125
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct clk_hw *ep93xx_clk_register_gate(const char *name,
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  127                                      const char *parent_name,
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  128                                      void __iomem *reg,
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  129                                      u8 bit_idx)
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  130  {
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  131          struct clk_init_data init;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  132          struct clk_psc *psc;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  133          struct clk *clk;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  134
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  135          psc = kzalloc(sizeof(*psc), GFP_KERNEL);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  136          if (!psc)
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  137                  return ERR_PTR(-ENOMEM);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  138
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  139          init.name = name;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  140          init.ops = &clk_ep93xx_gate_ops;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  141          init.flags = CLK_SET_RATE_PARENT;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  142          init.parent_names = (parent_name ? &parent_name : NULL);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  143          init.num_parents = (parent_name ? 1 : 0);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  144
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  145          psc->reg = reg;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  146          psc->bit_idx = bit_idx;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  147          psc->hw.init = &init;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  148          psc->lock = &clk_lock;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  149
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  150          clk = clk_register(NULL, &psc->hw);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  151          if (IS_ERR(clk))
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  152                  kfree(psc);

probably should `return ERR_CAST(clk);` ?

> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  153
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154          return &psc->hw;
> ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
> ff05c0330b9880 Hartley Sweeten 2009-05-07  156
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
@ 2022-01-24 21:50     ` Nick Desaulniers
  0 siblings, 0 replies; 13+ messages in thread
From: Nick Desaulniers @ 2022-01-24 21:50 UTC (permalink / raw)
  To: kbuild-all

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

On Wed, Jan 19, 2022 at 5:46 PM kernel test robot <yujie.liu@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   1d1df41c5a33359a00e919d54eaebfb789711fdc
> commit: 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert in-place to COMMON_CLK
> date:   3 months ago
> config: arm-randconfig-c002-20220118 (https://download.01.org/0day-ci/archive/20220120/202201200359.lTk9zHg4-lkp(a)intel.com/config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
> 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 arm cross compiling tool for clang build
>          # apt-get install binutils-arm-linux-gnueabi
>          # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
>          git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>          git fetch --no-tags linus master
>          git checkout 9645ccc7bd7a16cd73c3be9dee70cd702b03be37
>          # save the config file to linux build tree
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer

Hey! This check finally caught something that looks legit! Cool to see
0day bot running clang-analyzer, too!
Nikita, can you PTAL?

>
> 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 >>)
>
>  >> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
>             return &psc->hw;
>             ^
>     arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
>             if (IS_ERR(clk))
>             ^
>     arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
>                     kfree(psc);
>                     ^~~~~~~~~~
>     arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after it is freed
>             return &psc->hw;
>             ^      ~~~~~~~~
>  >> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
>             hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
>             ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  >> arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
>             hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
>             ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> vim +154 arch/arm/mach-ep93xx/clock.c
>
> ff05c0330b9880 Hartley Sweeten 2009-05-07  125
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct clk_hw *ep93xx_clk_register_gate(const char *name,
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  127                                      const char *parent_name,
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  128                                      void __iomem *reg,
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  129                                      u8 bit_idx)
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  130  {
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  131          struct clk_init_data init;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  132          struct clk_psc *psc;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  133          struct clk *clk;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  134
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  135          psc = kzalloc(sizeof(*psc), GFP_KERNEL);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  136          if (!psc)
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  137                  return ERR_PTR(-ENOMEM);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  138
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  139          init.name = name;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  140          init.ops = &clk_ep93xx_gate_ops;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  141          init.flags = CLK_SET_RATE_PARENT;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  142          init.parent_names = (parent_name ? &parent_name : NULL);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  143          init.num_parents = (parent_name ? 1 : 0);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  144
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  145          psc->reg = reg;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  146          psc->bit_idx = bit_idx;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  147          psc->hw.init = &init;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  148          psc->lock = &clk_lock;
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  149
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  150          clk = clk_register(NULL, &psc->hw);
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  151          if (IS_ERR(clk))
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  152                  kfree(psc);

probably should `return ERR_CAST(clk);` ?

> 9645ccc7bd7a16 Nikita Shubin   2021-10-18  153
> 9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154          return &psc->hw;
> ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
> ff05c0330b9880 Hartley Sweeten 2009-05-07  156
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
  2022-01-24 21:50     ` Nick Desaulniers
@ 2022-01-25  8:01       ` Nikita Shubin
  -1 siblings, 0 replies; 13+ messages in thread
From: Nikita Shubin @ 2022-01-25  8:01 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: llvm, kbuild-all, Linux Kernel Mailing List, Arnd Bergmann,
	Alexander Sverdlin, kernel test robot, Nathan Huckleberry,
	Philip Li

Hello Nick,

On Mon, 24 Jan 2022 13:50:02 -0800
Nick Desaulniers <ndesaulniers@google.com> wrote:

> On Wed, Jan 19, 2022 at 5:46 PM kernel test robot
> <yujie.liu@intel.com> wrote:
> >
> > tree:
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > master head:   1d1df41c5a33359a00e919d54eaebfb789711fdc commit:
> > 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert
> > in-place to COMMON_CLK date:   3 months ago config:
> > arm-randconfig-c002-20220118
> > (https://download.01.org/0day-ci/archive/20220120/202201200359.lTk9zHg4-lkp@intel.com/config)
> > compiler: clang version 14.0.0
> > (https://github.com/llvm/llvm-project
> > 5f782d25a742302d25ef3c8b84b54f7483c2deb9) 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 arm cross
> > compiling tool for clang build # apt-get install
> > binutils-arm-linux-gnueabi #
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
> > git remote add linus
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > git fetch --no-tags linus master git checkout
> > 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 # save the config file to
> > linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang
> > make.cross ARCH=arm clang-analyzer  
> 
> Hey! This check finally caught something that looks legit! Cool to see
> 0day bot running clang-analyzer, too!
> Nikita, can you PTAL?

Of course, i thought Alexander Sverdlin - already took care of it, he
is really fast and fires patches before i even realize what happens.

Alexander have you already taken care of it ? If not it's my turn to
clear my own mess.

> 
> >
> > 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 >>)
> >  
> >  >> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory
> >  >> after it is freed [clang-analyzer-unix.Malloc]  
> >             return &psc->hw;
> >             ^
> >     arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
> >             if (IS_ERR(clk))
> >             ^
> >     arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
> >                     kfree(psc);
> >                     ^~~~~~~~~~
> >     arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after
> > it is freed return &psc->hw;
> >             ^      ~~~~~~~~  
> >  >> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to
> >  >> 'hw' is never read [clang-analyzer-deadcode.DeadStores]  
> >             hw = clk_hw_register_fixed_factor(NULL, "uart",
> > "xtali", 0, 1, clk_uart_div); ^
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >  
> >  >> arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to
> >  >> 'hw' is never read [clang-analyzer-deadcode.DeadStores]  
> >             hw = clk_hw_register_fixed_factor(NULL, "usb_clk",
> > "pll2", 0, 1, clk_usb_div); ^
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > vim +154 arch/arm/mach-ep93xx/clock.c
> >
> > ff05c0330b9880 Hartley Sweeten 2009-05-07  125
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct
> > clk_hw *ep93xx_clk_register_gate(const char *name, 9645ccc7bd7a16
> > Nikita Shubin   2021-10-18  127
> >  const char *parent_name, 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> >  128                                      void __iomem *reg,
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  129
> >                 u8 bit_idx) 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  130  { 9645ccc7bd7a16 Nikita Shubin   2021-10-18  131
> >        struct clk_init_data init; 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  132          struct clk_psc *psc; 9645ccc7bd7a16 Nikita
> > Shubin   2021-10-18  133          struct clk *clk; 9645ccc7bd7a16
> > Nikita Shubin   2021-10-18  134 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  135          psc = kzalloc(sizeof(*psc), GFP_KERNEL);
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  136          if (!psc)
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  137
> > return ERR_PTR(-ENOMEM); 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > 138 9645ccc7bd7a16 Nikita Shubin   2021-10-18  139
> > init.name = name; 9645ccc7bd7a16 Nikita Shubin   2021-10-18  140
> >       init.ops = &clk_ep93xx_gate_ops; 9645ccc7bd7a16 Nikita Shubin
> >   2021-10-18  141          init.flags = CLK_SET_RATE_PARENT;
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  142
> > init.parent_names = (parent_name ? &parent_name : NULL);
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  143
> > init.num_parents = (parent_name ? 1 : 0); 9645ccc7bd7a16 Nikita
> > Shubin   2021-10-18  144 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > 145          psc->reg = reg; 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  146          psc->bit_idx = bit_idx; 9645ccc7bd7a16
> > Nikita Shubin   2021-10-18  147          psc->hw.init = &init;
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  148          psc->lock =
> > &clk_lock; 9645ccc7bd7a16 Nikita Shubin   2021-10-18  149
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  150          clk =
> > clk_register(NULL, &psc->hw); 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  151          if (IS_ERR(clk)) 9645ccc7bd7a16 Nikita
> > Shubin   2021-10-18  152                  kfree(psc);  
> 
> probably should `return ERR_CAST(clk);` ?
> 
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  153
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154          return
> > &psc->hw; ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
> > ff05c0330b9880 Hartley Sweeten 2009-05-07  156
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> >  
> 
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
@ 2022-01-25  8:01       ` Nikita Shubin
  0 siblings, 0 replies; 13+ messages in thread
From: Nikita Shubin @ 2022-01-25  8:01 UTC (permalink / raw)
  To: kbuild-all

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

Hello Nick,

On Mon, 24 Jan 2022 13:50:02 -0800
Nick Desaulniers <ndesaulniers@google.com> wrote:

> On Wed, Jan 19, 2022 at 5:46 PM kernel test robot
> <yujie.liu@intel.com> wrote:
> >
> > tree:
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > master head:   1d1df41c5a33359a00e919d54eaebfb789711fdc commit:
> > 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert
> > in-place to COMMON_CLK date:   3 months ago config:
> > arm-randconfig-c002-20220118
> > (https://download.01.org/0day-ci/archive/20220120/202201200359.lTk9zHg4-lkp(a)intel.com/config)
> > compiler: clang version 14.0.0
> > (https://github.com/llvm/llvm-project
> > 5f782d25a742302d25ef3c8b84b54f7483c2deb9) 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 arm cross
> > compiling tool for clang build # apt-get install
> > binutils-arm-linux-gnueabi #
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
> > git remote add linus
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > git fetch --no-tags linus master git checkout
> > 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 # save the config file to
> > linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang
> > make.cross ARCH=arm clang-analyzer  
> 
> Hey! This check finally caught something that looks legit! Cool to see
> 0day bot running clang-analyzer, too!
> Nikita, can you PTAL?

Of course, i thought Alexander Sverdlin - already took care of it, he
is really fast and fires patches before i even realize what happens.

Alexander have you already taken care of it ? If not it's my turn to
clear my own mess.

> 
> >
> > 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 >>)
> >  
> >  >> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory
> >  >> after it is freed [clang-analyzer-unix.Malloc]  
> >             return &psc->hw;
> >             ^
> >     arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
> >             if (IS_ERR(clk))
> >             ^
> >     arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
> >                     kfree(psc);
> >                     ^~~~~~~~~~
> >     arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after
> > it is freed return &psc->hw;
> >             ^      ~~~~~~~~  
> >  >> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to
> >  >> 'hw' is never read [clang-analyzer-deadcode.DeadStores]  
> >             hw = clk_hw_register_fixed_factor(NULL, "uart",
> > "xtali", 0, 1, clk_uart_div); ^
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >  
> >  >> arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to
> >  >> 'hw' is never read [clang-analyzer-deadcode.DeadStores]  
> >             hw = clk_hw_register_fixed_factor(NULL, "usb_clk",
> > "pll2", 0, 1, clk_usb_div); ^
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > vim +154 arch/arm/mach-ep93xx/clock.c
> >
> > ff05c0330b9880 Hartley Sweeten 2009-05-07  125
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct
> > clk_hw *ep93xx_clk_register_gate(const char *name, 9645ccc7bd7a16
> > Nikita Shubin   2021-10-18  127
> >  const char *parent_name, 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> >  128                                      void __iomem *reg,
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  129
> >                 u8 bit_idx) 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  130  { 9645ccc7bd7a16 Nikita Shubin   2021-10-18  131
> >        struct clk_init_data init; 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  132          struct clk_psc *psc; 9645ccc7bd7a16 Nikita
> > Shubin   2021-10-18  133          struct clk *clk; 9645ccc7bd7a16
> > Nikita Shubin   2021-10-18  134 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  135          psc = kzalloc(sizeof(*psc), GFP_KERNEL);
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  136          if (!psc)
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  137
> > return ERR_PTR(-ENOMEM); 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > 138 9645ccc7bd7a16 Nikita Shubin   2021-10-18  139
> > init.name = name; 9645ccc7bd7a16 Nikita Shubin   2021-10-18  140
> >       init.ops = &clk_ep93xx_gate_ops; 9645ccc7bd7a16 Nikita Shubin
> >   2021-10-18  141          init.flags = CLK_SET_RATE_PARENT;
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  142
> > init.parent_names = (parent_name ? &parent_name : NULL);
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  143
> > init.num_parents = (parent_name ? 1 : 0); 9645ccc7bd7a16 Nikita
> > Shubin   2021-10-18  144 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > 145          psc->reg = reg; 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  146          psc->bit_idx = bit_idx; 9645ccc7bd7a16
> > Nikita Shubin   2021-10-18  147          psc->hw.init = &init;
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  148          psc->lock =
> > &clk_lock; 9645ccc7bd7a16 Nikita Shubin   2021-10-18  149
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  150          clk =
> > clk_register(NULL, &psc->hw); 9645ccc7bd7a16 Nikita Shubin
> > 2021-10-18  151          if (IS_ERR(clk)) 9645ccc7bd7a16 Nikita
> > Shubin   2021-10-18  152                  kfree(psc);  
> 
> probably should `return ERR_CAST(clk);` ?
> 
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  153
> > 9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154          return
> > &psc->hw; ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
> > ff05c0330b9880 Hartley Sweeten 2009-05-07  156
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
> >  
> 
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
  2022-01-25  8:01       ` Nikita Shubin
@ 2022-01-25 21:08         ` Nick Desaulniers
  -1 siblings, 0 replies; 13+ messages in thread
From: Nick Desaulniers @ 2022-01-25 21:08 UTC (permalink / raw)
  To: Nikita Shubin
  Cc: llvm, kbuild-all, Linux Kernel Mailing List, Arnd Bergmann,
	Alexander Sverdlin, kernel test robot, Nathan Huckleberry,
	Philip Li

On Tue, Jan 25, 2022 at 12:01 AM Nikita Shubin
<nikita.shubin@maquefel.me> wrote:
>
> Hello Nick,
>
> On Mon, 24 Jan 2022 13:50:02 -0800
> Nick Desaulniers <ndesaulniers@google.com> wrote:
>
> > On Wed, Jan 19, 2022 at 5:46 PM kernel test robot
> > <yujie.liu@intel.com> wrote:
> > >
> > > tree:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > master head:   1d1df41c5a33359a00e919d54eaebfb789711fdc commit:
> > > 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert
> > > in-place to COMMON_CLK date:   3 months ago config:
> > > arm-randconfig-c002-20220118
> > > (https://download.01.org/0day-ci/archive/20220120/202201200359.lTk9zHg4-lkp@intel.com/config)
> > > compiler: clang version 14.0.0
> > > (https://github.com/llvm/llvm-project
> > > 5f782d25a742302d25ef3c8b84b54f7483c2deb9) 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 arm cross
> > > compiling tool for clang build # apt-get install
> > > binutils-arm-linux-gnueabi #
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
> > > git remote add linus
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > git fetch --no-tags linus master git checkout
> > > 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 # save the config file to
> > > linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang
> > > make.cross ARCH=arm clang-analyzer
> >
> > Hey! This check finally caught something that looks legit! Cool to see
> > 0day bot running clang-analyzer, too!
> > Nikita, can you PTAL?
>
> Of course, i thought Alexander Sverdlin - already took care of it, he
> is really fast and fires patches before i even realize what happens.
>
> Alexander have you already taken care of it ? If not it's my turn to
> clear my own mess.

Alexander sent me privately the link to:
https://lore.kernel.org/lkml/20220120133739.4170298-2-alexander.sverdlin@gmail.com/T/

>
> >
> > >
> > > 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 >>)
> > >
> > >  >> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory
> > >  >> after it is freed [clang-analyzer-unix.Malloc]
> > >             return &psc->hw;
> > >             ^
> > >     arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
> > >             if (IS_ERR(clk))
> > >             ^
> > >     arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
> > >                     kfree(psc);
> > >                     ^~~~~~~~~~
> > >     arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after
> > > it is freed return &psc->hw;
> > >             ^      ~~~~~~~~
> > >  >> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to
> > >  >> 'hw' is never read [clang-analyzer-deadcode.DeadStores]
> > >             hw = clk_hw_register_fixed_factor(NULL, "uart",
> > > "xtali", 0, 1, clk_uart_div); ^
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> > >  >> arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to
> > >  >> 'hw' is never read [clang-analyzer-deadcode.DeadStores]
> > >             hw = clk_hw_register_fixed_factor(NULL, "usb_clk",
> > > "pll2", 0, 1, clk_usb_div); ^
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> > > vim +154 arch/arm/mach-ep93xx/clock.c
> > >
> > > ff05c0330b9880 Hartley Sweeten 2009-05-07  125
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct
> > > clk_hw *ep93xx_clk_register_gate(const char *name, 9645ccc7bd7a16
> > > Nikita Shubin   2021-10-18  127
> > >  const char *parent_name, 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > >  128                                      void __iomem *reg,
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  129
> > >                 u8 bit_idx) 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  130  { 9645ccc7bd7a16 Nikita Shubin   2021-10-18  131
> > >        struct clk_init_data init; 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  132          struct clk_psc *psc; 9645ccc7bd7a16 Nikita
> > > Shubin   2021-10-18  133          struct clk *clk; 9645ccc7bd7a16
> > > Nikita Shubin   2021-10-18  134 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  135          psc = kzalloc(sizeof(*psc), GFP_KERNEL);
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  136          if (!psc)
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  137
> > > return ERR_PTR(-ENOMEM); 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > > 138 9645ccc7bd7a16 Nikita Shubin   2021-10-18  139
> > > init.name = name; 9645ccc7bd7a16 Nikita Shubin   2021-10-18  140
> > >       init.ops = &clk_ep93xx_gate_ops; 9645ccc7bd7a16 Nikita Shubin
> > >   2021-10-18  141          init.flags = CLK_SET_RATE_PARENT;
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  142
> > > init.parent_names = (parent_name ? &parent_name : NULL);
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  143
> > > init.num_parents = (parent_name ? 1 : 0); 9645ccc7bd7a16 Nikita
> > > Shubin   2021-10-18  144 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > > 145          psc->reg = reg; 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  146          psc->bit_idx = bit_idx; 9645ccc7bd7a16
> > > Nikita Shubin   2021-10-18  147          psc->hw.init = &init;
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  148          psc->lock =
> > > &clk_lock; 9645ccc7bd7a16 Nikita Shubin   2021-10-18  149
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  150          clk =
> > > clk_register(NULL, &psc->hw); 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  151          if (IS_ERR(clk)) 9645ccc7bd7a16 Nikita
> > > Shubin   2021-10-18  152                  kfree(psc);
> >
> > probably should `return ERR_CAST(clk);` ?
> >
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  153
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154          return
> > > &psc->hw; ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
> > > ff05c0330b9880 Hartley Sweeten 2009-05-07  156
> > >
> > > ---
> > > 0-DAY CI Kernel Test Service, Intel Corporation
> > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> > >
> >
> >
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
@ 2022-01-25 21:08         ` Nick Desaulniers
  0 siblings, 0 replies; 13+ messages in thread
From: Nick Desaulniers @ 2022-01-25 21:08 UTC (permalink / raw)
  To: kbuild-all

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

On Tue, Jan 25, 2022 at 12:01 AM Nikita Shubin
<nikita.shubin@maquefel.me> wrote:
>
> Hello Nick,
>
> On Mon, 24 Jan 2022 13:50:02 -0800
> Nick Desaulniers <ndesaulniers@google.com> wrote:
>
> > On Wed, Jan 19, 2022 at 5:46 PM kernel test robot
> > <yujie.liu@intel.com> wrote:
> > >
> > > tree:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > master head:   1d1df41c5a33359a00e919d54eaebfb789711fdc commit:
> > > 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert
> > > in-place to COMMON_CLK date:   3 months ago config:
> > > arm-randconfig-c002-20220118
> > > (https://download.01.org/0day-ci/archive/20220120/202201200359.lTk9zHg4-lkp(a)intel.com/config)
> > > compiler: clang version 14.0.0
> > > (https://github.com/llvm/llvm-project
> > > 5f782d25a742302d25ef3c8b84b54f7483c2deb9) 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 arm cross
> > > compiling tool for clang build # apt-get install
> > > binutils-arm-linux-gnueabi #
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
> > > git remote add linus
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > git fetch --no-tags linus master git checkout
> > > 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 # save the config file to
> > > linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang
> > > make.cross ARCH=arm clang-analyzer
> >
> > Hey! This check finally caught something that looks legit! Cool to see
> > 0day bot running clang-analyzer, too!
> > Nikita, can you PTAL?
>
> Of course, i thought Alexander Sverdlin - already took care of it, he
> is really fast and fires patches before i even realize what happens.
>
> Alexander have you already taken care of it ? If not it's my turn to
> clear my own mess.

Alexander sent me privately the link to:
https://lore.kernel.org/lkml/20220120133739.4170298-2-alexander.sverdlin(a)gmail.com/T/

>
> >
> > >
> > > 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 >>)
> > >
> > >  >> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory
> > >  >> after it is freed [clang-analyzer-unix.Malloc]
> > >             return &psc->hw;
> > >             ^
> > >     arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
> > >             if (IS_ERR(clk))
> > >             ^
> > >     arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
> > >                     kfree(psc);
> > >                     ^~~~~~~~~~
> > >     arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after
> > > it is freed return &psc->hw;
> > >             ^      ~~~~~~~~
> > >  >> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to
> > >  >> 'hw' is never read [clang-analyzer-deadcode.DeadStores]
> > >             hw = clk_hw_register_fixed_factor(NULL, "uart",
> > > "xtali", 0, 1, clk_uart_div); ^
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> > >  >> arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to
> > >  >> 'hw' is never read [clang-analyzer-deadcode.DeadStores]
> > >             hw = clk_hw_register_fixed_factor(NULL, "usb_clk",
> > > "pll2", 0, 1, clk_usb_div); ^
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> > > vim +154 arch/arm/mach-ep93xx/clock.c
> > >
> > > ff05c0330b9880 Hartley Sweeten 2009-05-07  125
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct
> > > clk_hw *ep93xx_clk_register_gate(const char *name, 9645ccc7bd7a16
> > > Nikita Shubin   2021-10-18  127
> > >  const char *parent_name, 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > >  128                                      void __iomem *reg,
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  129
> > >                 u8 bit_idx) 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  130  { 9645ccc7bd7a16 Nikita Shubin   2021-10-18  131
> > >        struct clk_init_data init; 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  132          struct clk_psc *psc; 9645ccc7bd7a16 Nikita
> > > Shubin   2021-10-18  133          struct clk *clk; 9645ccc7bd7a16
> > > Nikita Shubin   2021-10-18  134 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  135          psc = kzalloc(sizeof(*psc), GFP_KERNEL);
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  136          if (!psc)
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  137
> > > return ERR_PTR(-ENOMEM); 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > > 138 9645ccc7bd7a16 Nikita Shubin   2021-10-18  139
> > > init.name = name; 9645ccc7bd7a16 Nikita Shubin   2021-10-18  140
> > >       init.ops = &clk_ep93xx_gate_ops; 9645ccc7bd7a16 Nikita Shubin
> > >   2021-10-18  141          init.flags = CLK_SET_RATE_PARENT;
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  142
> > > init.parent_names = (parent_name ? &parent_name : NULL);
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  143
> > > init.num_parents = (parent_name ? 1 : 0); 9645ccc7bd7a16 Nikita
> > > Shubin   2021-10-18  144 9645ccc7bd7a16 Nikita Shubin   2021-10-18
> > > 145          psc->reg = reg; 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  146          psc->bit_idx = bit_idx; 9645ccc7bd7a16
> > > Nikita Shubin   2021-10-18  147          psc->hw.init = &init;
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  148          psc->lock =
> > > &clk_lock; 9645ccc7bd7a16 Nikita Shubin   2021-10-18  149
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  150          clk =
> > > clk_register(NULL, &psc->hw); 9645ccc7bd7a16 Nikita Shubin
> > > 2021-10-18  151          if (IS_ERR(clk)) 9645ccc7bd7a16 Nikita
> > > Shubin   2021-10-18  152                  kfree(psc);
> >
> > probably should `return ERR_CAST(clk);` ?
> >
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18  153
> > > 9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154          return
> > > &psc->hw; ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
> > > ff05c0330b9880 Hartley Sweeten 2009-05-07  156
> > >
> > > ---
> > > 0-DAY CI Kernel Test Service, Intel Corporation
> > > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
> > >
> >
> >
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 13+ messages in thread

* arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
@ 2022-01-02  1:50 kernel test robot
  0 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2022-01-02  1:50 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nikita Shubin <nikita.shubin@maquefel.me>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Alexander Sverdlin <alexander.sverdlin@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   278218f6778bc7d6f8b67199446c56cec7ebb841
commit: 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert in-place to COMMON_CLK
date:   2 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 2 months ago
config: arm-randconfig-c002-20220101 (https://download.01.org/0day-ci/archive/20220102/202201020954.6w3vdd8s-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c054402170cd8466683a20385befc0523aba3359)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 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 >>)
           ^
   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:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/dma/ti/omap-dma.c:1521:3: note: Memory is released
                   kfree(c);
                   ^~~~~~~~
   drivers/dma/ti/omap-dma.c:1515:2: note: Loop condition is true.  Entering loop body
           while (!list_empty(&od->ddev.channels)) {
           ^
   drivers/dma/ti/omap-dma.c:1516:25: note: Left side of '&&' is false
                   struct omap_chan *c = list_first_entry(&od->ddev.channels,
                                         ^
   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:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/dma/ti/omap-dma.c:1516:25: note: Taking false branch
                   struct omap_chan *c = list_first_entry(&od->ddev.channels,
                                         ^
   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:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:302:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/dma/ti/omap-dma.c:1516:25: note: Loop condition is false.  Exiting loop
                   struct omap_chan *c = list_first_entry(&od->ddev.channels,
                                         ^
   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:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/dma/ti/omap-dma.c:1519:3: note: Calling 'list_del'
                   list_del(&c->vc.chan.device_node);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/list.h:147:14: note: Use of memory after it is freed
           entry->next = LIST_POISON1;
           ~~~~~~~~~~~ ^
   Suppressed 9 warnings (9 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   9 warnings generated.
   Suppressed 9 warnings (8 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
>> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:579:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
           ^
   arch/arm/mach-ep93xx/clock.c:627:6: note: Assuming the condition is false
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:627:2: note: Taking false branch
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
           ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Left side of '&&' is true
           pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:370:7: note: expanded from macro '__printk_index_emit'
                   if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \
                       ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Taking true branch
           pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:370:3: note: expanded from macro '__printk_index_emit'
                   if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \
                   ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: '?' condition is true
           pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:379:12: note: expanded from macro '__printk_index_emit'
                                   .fmt = __builtin_constant_p(_fmt) ? (_fmt) : NULL, \
                                          ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: '?' condition is true
           pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:383:14: note: expanded from macro '__printk_index_emit'
                                   .level = __builtin_constant_p(_level) ? (_level) : NULL, \
                                            ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Loop condition is false.  Exiting loop
           pr_info("PLL1 running at %ld MHz, PLL2@%ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:369:2: note: expanded from macro '__printk_index_emit'
           do {                                                            \
           ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Left side of '&&' is true
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
--
   include/linux/printk.h:369:2: note: expanded from macro '__printk_index_emit'
           do {                                                            \
           ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Left side of '&&' is true
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:370:7: note: expanded from macro '__printk_index_emit'
                   if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \
                       ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Taking true branch
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:370:3: note: expanded from macro '__printk_index_emit'
                   if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \
                   ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: '?' condition is true
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:379:12: note: expanded from macro '__printk_index_emit'
                                   .fmt = __builtin_constant_p(_fmt) ? (_fmt) : NULL, \
                                          ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: '?' condition is true
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:383:14: note: expanded from macro '__printk_index_emit'
                                   .level = __builtin_constant_p(_level) ? (_level) : NULL, \
                                            ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Loop condition is false.  Exiting loop
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:369:2: note: expanded from macro '__printk_index_emit'
           do {                                                            \
           ^
   arch/arm/mach-ep93xx/clock.c:645:7: note: Calling 'clk_hw_register_div'
           hw = clk_hw_register_div("ep93xx-adc",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:434:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:434:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:440:23: note: 'parent_name' is non-null
           init.parent_names = (parent_name ? &parent_name : NULL);
                                ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:440:23: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:453:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:454:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:456:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
>> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:484:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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 (2 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   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.
   drivers/pwm/core.c:427:20: warning: Value stored to 'last' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct pwm_state *last = &pwm->last;
                             ^~~~   ~~~~~~~~~~
   drivers/pwm/core.c:427:20: note: Value stored to 'last' during its initialization is never read
           struct pwm_state *last = &pwm->last;
                             ^~~~   ~~~~~~~~~~
   drivers/pwm/core.c:428:19: warning: Value stored to 'chip' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct pwm_chip *chip = pwm->chip;
                            ^~~~   ~~~~~~~~~
   drivers/pwm/core.c:428:19: note: Value stored to 'chip' during its initialization is never read
           struct pwm_chip *chip = pwm->chip;
                            ^~~~   ~~~~~~~~~
   drivers/pwm/core.c:816:13: warning: Access to field 'name' results in a dereference of a null pointer (loaded from variable 'np') [clang-analyzer-core.NullDereference]
                           con_id = np->name;
                                    ^
   drivers/pwm/core.c:1148:6: note: Assuming the condition is true
           if (is_of_node(fwnode))
               ^~~~~~~~~~~~~~~~~~
   drivers/pwm/core.c:1148:2: note: Taking true branch
           if (is_of_node(fwnode))
           ^
   drivers/pwm/core.c:1149:25: note: Assuming the condition is false
                   pwm = of_pwm_get(dev, to_of_node(fwnode), con_id);
                                         ^
   include/linux/of.h:164:3: note: expanded from macro 'to_of_node'
                   is_of_node(__to_of_node_fwnode) ?                       \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pwm/core.c:1149:25: note: '?' condition is false
                   pwm = of_pwm_get(dev, to_of_node(fwnode), con_id);
                                         ^
   include/linux/of.h:164:3: note: expanded from macro 'to_of_node'
                   is_of_node(__to_of_node_fwnode) ?                       \
                   ^
   drivers/pwm/core.c:1149:25: note: Passing null pointer value via 2nd parameter 'np'
                   pwm = of_pwm_get(dev, to_of_node(fwnode), con_id);
                                         ^
   include/linux/of.h:161:2: note: expanded from macro 'to_of_node'
           ({                                                              \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pwm/core.c:1149:9: note: Calling 'of_pwm_get'
                   pwm = of_pwm_get(dev, to_of_node(fwnode), con_id);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/pwm/core.c:773:6: note: Assuming 'con_id' is null
           if (con_id) {
               ^~~~~~
   drivers/pwm/core.c:773:2: note: Taking false branch
           if (con_id) {
           ^
   drivers/pwm/core.c:781:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   drivers/pwm/core.c:781:2: note: Taking false branch
           if (err) {
           ^
   drivers/pwm/core.c:786:25: note: Assuming '__of_fwnode_handle_node' is null
           pc = fwnode_to_pwmchip(of_fwnode_handle(args.np));
                                  ^
   include/linux/of.h:174:3: note: expanded from macro 'of_fwnode_handle'
                   __of_fwnode_handle_node ?                               \
                   ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/pwm/core.c:786:25: note: '?' condition is false
           pc = fwnode_to_pwmchip(of_fwnode_handle(args.np));
                                  ^
   include/linux/of.h:174:3: note: expanded from macro 'of_fwnode_handle'
                   __of_fwnode_handle_node ?                               \
                   ^
   drivers/pwm/core.c:787:6: note: Calling 'IS_ERR'
           if (IS_ERR(pc)) {

vim +154 arch/arm/mach-ep93xx/clock.c

ff05c0330b9880 Hartley Sweeten 2009-05-07  125  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct clk_hw *ep93xx_clk_register_gate(const char *name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  127  				    const char *parent_name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  128  				    void __iomem *reg,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  129  				    u8 bit_idx)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  130  {
9645ccc7bd7a16 Nikita Shubin   2021-10-18  131  	struct clk_init_data init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  132  	struct clk_psc *psc;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  133  	struct clk *clk;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  134  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  135  	psc = kzalloc(sizeof(*psc), GFP_KERNEL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  136  	if (!psc)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  137  		return ERR_PTR(-ENOMEM);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  138  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  139  	init.name = name;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  140  	init.ops = &clk_ep93xx_gate_ops;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  141  	init.flags = CLK_SET_RATE_PARENT;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  142  	init.parent_names = (parent_name ? &parent_name : NULL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  143  	init.num_parents = (parent_name ? 1 : 0);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  144  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  145  	psc->reg = reg;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  146  	psc->bit_idx = bit_idx;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  147  	psc->hw.init = &init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  148  	psc->lock = &clk_lock;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  149  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  150  	clk = clk_register(NULL, &psc->hw);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  151  	if (IS_ERR(clk))
9645ccc7bd7a16 Nikita Shubin   2021-10-18  152  		kfree(psc);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  153  
9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154  	return &psc->hw;
ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
ff05c0330b9880 Hartley Sweeten 2009-05-07  156  

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
@ 2021-12-16  6:54 kernel test robot
  0 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2021-12-16  6:54 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nikita Shubin <nikita.shubin@maquefel.me>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Alexander Sverdlin <alexander.sverdlin@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5472f14a37421d1bca3dddf33cabd3bd6dbefbbc
commit: 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert in-place to COMMON_CLK
date:   8 weeks ago
:::::: branch date: 2 days ago
:::::: commit date: 8 weeks ago
config: arm-randconfig-c002-20211209 (https://download.01.org/0day-ci/archive/20211216/202112161446.ILUdUWQk-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 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 >>)
           ^~~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:55:30: note: expanded from macro '__WRITE_ONCE'
           *(volatile typeof(x) *)&(x) = (val);                            \
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   init/initramfs.c:97:11: warning: Access to field 'major' results in a dereference of a null pointer (loaded from variable 'q') [clang-analyzer-core.NullDereference]
           q->major = major;
                    ^
   init/initramfs.c:341:6: note: Assuming the condition is false
           if (strcmp(collected, "TRAILER!!!") == 0) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   init/initramfs.c:341:2: note: Taking false branch
           if (strcmp(collected, "TRAILER!!!") == 0) {
           ^
   init/initramfs.c:346:6: note: Assuming the condition is true
           if (S_ISREG(mode)) {
               ^
   include/uapi/linux/stat.h:22:21: note: expanded from macro 'S_ISREG'
   #define S_ISREG(m)      (((m) & S_IFMT) == S_IFREG)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
   init/initramfs.c:346:2: note: Taking true branch
           if (S_ISREG(mode)) {
           ^
   init/initramfs.c:347:12: note: Calling 'maybe_link'
                   int ml = maybe_link();
                            ^~~~~~~~~~~~
   init/initramfs.c:324:6: note: Assuming 'nlink' is >= 2
           if (nlink >= 2) {
               ^~~~~~~~~~
   init/initramfs.c:324:2: note: Taking true branch
           if (nlink >= 2) {
           ^
   init/initramfs.c:325:15: note: Calling 'find_link'
                   char *old = find_link(major, minor, ino, mode, collected);
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   init/initramfs.c:83:2: note: Loop condition is false. Execution continues on line 94
           for (p = head + hash(major, minor, ino); *p; p = &(*p)->next) {
           ^
   init/initramfs.c:94:6: note: Calling 'kmalloc'
           q = kmalloc(sizeof(struct hash), GFP_KERNEL);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:579:2: note: Taking false branch
           if (__builtin_constant_p(size)) {
           ^
   include/linux/slab.h:596:2: note: Returning pointer
           return __kmalloc(size, flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   init/initramfs.c:94:6: note: Returning from 'kmalloc'
           q = kmalloc(sizeof(struct hash), GFP_KERNEL);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   init/initramfs.c:94:2: note: Value assigned to 'q'
           q = kmalloc(sizeof(struct hash), GFP_KERNEL);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   init/initramfs.c:95:6: note: Assuming 'q' is null
           if (!q)
               ^~
   init/initramfs.c:95:2: note: Taking true branch
           if (!q)
           ^
   init/initramfs.c:97:11: note: Access to field 'major' results in a dereference of a null pointer (loaded from variable 'q')
           q->major = major;
           ~        ^
   init/initramfs.c:101: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(q->name, name);
           ^~~~~~
   init/initramfs.c:101: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(q->name, name);
           ^~~~~~
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   13 warnings generated.
>> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:579:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
           ^
   arch/arm/mach-ep93xx/clock.c:627:6: note: Assuming the condition is false
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:627:2: note: Taking false branch
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
           ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Left side of '&&' is true
           pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:370:7: note: expanded from macro '__printk_index_emit'
                   if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \
                       ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Taking true branch
           pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:370:3: note: expanded from macro '__printk_index_emit'
                   if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \
                   ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: '?' condition is true
           pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:379:12: note: expanded from macro '__printk_index_emit'
                                   .fmt = __builtin_constant_p(_fmt) ? (_fmt) : NULL, \
                                          ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: '?' condition is true
           pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:383:14: note: expanded from macro '__printk_index_emit'
                                   .level = __builtin_constant_p(_level) ? (_level) : NULL, \
                                            ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Loop condition is false.  Exiting loop
           pr_info("PLL1 running at %ld MHz, PLL2@%ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:369:2: note: expanded from macro '__printk_index_emit'
           do {                                                            \
           ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Left side of '&&' is true
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
--
   include/linux/printk.h:369:2: note: expanded from macro '__printk_index_emit'
           do {                                                            \
           ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Left side of '&&' is true
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:370:7: note: expanded from macro '__printk_index_emit'
                   if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \
                       ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Taking true branch
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:370:3: note: expanded from macro '__printk_index_emit'
                   if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \
                   ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: '?' condition is true
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:379:12: note: expanded from macro '__printk_index_emit'
                                   .fmt = __builtin_constant_p(_fmt) ? (_fmt) : NULL, \
                                          ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: '?' condition is true
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:383:14: note: expanded from macro '__printk_index_emit'
                                   .level = __builtin_constant_p(_level) ? (_level) : NULL, \
                                            ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Loop condition is false.  Exiting loop
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:369:2: note: expanded from macro '__printk_index_emit'
           do {                                                            \
           ^
   arch/arm/mach-ep93xx/clock.c:645:7: note: Calling 'clk_hw_register_div'
           hw = clk_hw_register_div("ep93xx-adc",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:434:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:434:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:440:23: note: 'parent_name' is non-null
           init.parent_names = (parent_name ? &parent_name : NULL);
                                ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:440:23: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:453:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:454:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:456:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
>> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:484:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 8 warnings (8 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.
   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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   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.
   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.
   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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   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.
   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.
   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.
   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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   10 warnings generated.
   drivers/clk/actions/owl-pll.c:28:9: warning: Although the value stored to 'mul' is used in the enclosing expression, the value is never actually read from 'mul' [clang-analyzer-deadcode.DeadStores]
           return mul &= mul_mask(pll_hw);
                  ^
   drivers/clk/actions/owl-pll.c:28:9: note: Although the value stored to 'mul' is used in the enclosing expression, the value is never actually read from 'mul'
   Suppressed 9 warnings (8 in non-user code, 1 with check filters).
   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.
   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.
   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.
   include/linux/math64.h:92:15: warning: Division by zero [clang-analyzer-core.DivideZero]
           *remainder = do_div(dividend, divisor);
                        ^
   include/asm-generic/div64.h:235:25: note: expanded from macro 'do_div'
--
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                  ^
   drivers/leds/led-core.c:424:2: note: Loop condition is false.  Exiting loop
           BUG_ON(props.color == LED_COLOR_ID_MULTI);
           ^
   include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON'
   #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                             ^
   drivers/leds/led-core.c:426:6: note: Assuming 'led_classdev_name' is non-null
           if (!led_classdev_name)
               ^~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:426:2: note: Taking false branch
           if (!led_classdev_name)
           ^
   drivers/leds/led-core.c:429:2: note: Calling 'led_parse_fwnode_props'
           led_parse_fwnode_props(dev, fwnode, &props);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:370:6: note: Assuming 'fwnode' is non-null
           if (!fwnode)
               ^~~~~~~
   drivers/leds/led-core.c:370:2: note: Taking false branch
           if (!fwnode)
           ^
   drivers/leds/led-core.c:373:6: note: Assuming the condition is false
           if (fwnode_property_present(fwnode, "label")) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:373:2: note: Taking false branch
           if (fwnode_property_present(fwnode, "label")) {
           ^
   drivers/leds/led-core.c:380:6: note: Assuming the condition is false
           if (fwnode_property_present(fwnode, "color")) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:380:2: note: Taking false branch
           if (fwnode_property_present(fwnode, "color")) {
           ^
   drivers/leds/led-core.c:391:6: note: Assuming the condition is true
           if (!fwnode_property_present(fwnode, "function"))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:391:2: note: Taking true branch
           if (!fwnode_property_present(fwnode, "function"))
           ^
   drivers/leds/led-core.c:392:3: note: Returning without writing to 'props->label', which participates in a condition later
                   return;
                   ^
   drivers/leds/led-core.c:392:3: note: Returning without writing to 'props->function', which participates in a condition later
   drivers/leds/led-core.c:392:3: note: Returning without writing to 'props->color_present', which participates in a condition later
   drivers/leds/led-core.c:429:2: note: Returning from 'led_parse_fwnode_props'
           led_parse_fwnode_props(dev, fwnode, &props);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:431:12: note: Field 'label' is null
           if (props.label) {
                     ^
   drivers/leds/led-core.c:431:2: note: Taking false branch
           if (props.label) {
           ^
   drivers/leds/led-core.c:445:19: note: Field 'function' is null
           } else if (props.function || props.color_present) {
                            ^
   drivers/leds/led-core.c:445:13: note: Left side of '||' is false
           } else if (props.function || props.color_present) {
                      ^
   drivers/leds/led-core.c:445:37: note: Field 'color_present' is false
           } else if (props.function || props.color_present) {
                                              ^
   drivers/leds/led-core.c:445:9: note: Taking false branch
           } else if (props.function || props.color_present) {
                  ^
   drivers/leds/led-core.c:464:13: note: Assuming field 'default_label' is null
           } else if (init_data->default_label) {
                      ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:464:9: note: Taking false branch
           } else if (init_data->default_label) {
                  ^
   drivers/leds/led-core.c:471:13: note: Assuming the condition is true
           } else if (is_of_node(fwnode)) {
                      ^~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:471:9: note: Taking true branch
           } else if (is_of_node(fwnode)) {
                  ^
   drivers/leds/led-core.c:472:30: note: Assuming the condition is false
                   strscpy(led_classdev_name, to_of_node(fwnode)->name,
                                              ^
   include/linux/of.h:164:3: note: expanded from macro 'to_of_node'
                   is_of_node(__to_of_node_fwnode) ?                       \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/leds/led-core.c:472:30: note: '?' condition is false
                   strscpy(led_classdev_name, to_of_node(fwnode)->name,
                                              ^
   include/linux/of.h:164:3: note: expanded from macro 'to_of_node'
                   is_of_node(__to_of_node_fwnode) ?                       \
                   ^
   drivers/leds/led-core.c:472:30: note: Access to field 'name' results in a dereference of a null pointer
                   strscpy(led_classdev_name, to_of_node(fwnode)->name,
                                              ^
   include/linux/of.h:161:2: note: expanded from macro 'to_of_node'
           ({                                                              \
           ^
   Suppressed 8 warnings (8 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.
   9 warnings generated.
>> drivers/gpu/drm/tegra/fb.c:126:14: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
                   fb->obj[i] = &planes[i]->gem;
                              ^
   drivers/gpu/drm/tegra/fb.c:150:14: note: Assuming 'i' is >= field 'num_planes'
           for (i = 0; i < info->num_planes; i++) {
                       ^~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/tegra/fb.c:150:2: note: Loop condition is false. Execution continues on line 174
           for (i = 0; i < info->num_planes; i++) {
           ^
   drivers/gpu/drm/tegra/fb.c:174:7: note: Calling 'tegra_fb_alloc'
           fb = tegra_fb_alloc(drm, cmd, planes, i);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/tegra/fb.c:119:7: note: Calling 'kzalloc'
           fb = kzalloc(sizeof(*fb), GFP_KERNEL);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:721:9: note: Calling 'kmalloc'
           return kmalloc(size, flags | __GFP_ZERO);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:579:2: note: Taking false branch
           if (__builtin_constant_p(size)) {
           ^
   include/linux/slab.h:596:2: note: Returning pointer, which participates in a condition later
           return __kmalloc(size, flags);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:721:9: note: Returning from 'kmalloc'
           return kmalloc(size, flags | __GFP_ZERO);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/slab.h:721:2: note: Returning pointer, which participates in a condition later
           return kmalloc(size, flags | __GFP_ZERO);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/tegra/fb.c:119:7: note: Returning from 'kzalloc'
           fb = kzalloc(sizeof(*fb), GFP_KERNEL);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/tegra/fb.c:120:6: note: Assuming 'fb' is non-null
           if (!fb)
               ^~~
   drivers/gpu/drm/tegra/fb.c:120:2: note: Taking false branch
           if (!fb)
           ^
   drivers/gpu/drm/tegra/fb.c:125:7: note: The value 0 is assigned to 'i'
           for (i = 0; i < fb->format->num_planes; i++)
                ^~~~~
   drivers/gpu/drm/tegra/fb.c:125:14: note: Assuming 'i' is < field 'num_planes'
           for (i = 0; i < fb->format->num_planes; i++)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/tegra/fb.c:125:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < fb->format->num_planes; i++)
           ^
   drivers/gpu/drm/tegra/fb.c:126:14: note: Assigned value is garbage or undefined
                   fb->obj[i] = &planes[i]->gem;
                              ^ ~~~~~~~~~~~~~~~
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   9 warnings generated.
   drivers/gpu/drm/etnaviv/etnaviv_gem.c:60:21: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct drm_device *dev = etnaviv_obj->base.dev;
                              ^~~   ~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/etnaviv/etnaviv_gem.c:60:21: note: Value stored to 'dev' during its initialization is never read
           struct drm_device *dev = etnaviv_obj->base.dev;
                              ^~~   ~~~~~~~~~~~~~~~~~~~~~
   Suppressed 8 warnings (8 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.
   9 warnings generated.
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1400:3: warning: Array subscript is undefined [clang-analyzer-core.uninitialized.ArraySubscript]
                   gpu->event[event[2]].sync_point = &sync_point_perfmon_sample_post;
                   ^          ~~~~~~~~
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1344:6: note: Assuming field 'runtime_resumed' is true
           if (!submit->runtime_resumed) {
               ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1344:2: note: Taking false branch
           if (!submit->runtime_resumed) {
           ^
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1360:6: note: Assuming field 'nr_pmrs' is 0
           if (submit->nr_pmrs)
               ^~~~~~~~~~~~~~~
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1360:2: note: Taking false branch
           if (submit->nr_pmrs)
           ^
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1363:8: note: Calling 'event_alloc'
           ret = event_alloc(gpu, nr_events, event);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1158:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < nr_events; i++) {
           ^
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1163:7: note: Assuming 'ret' is not equal to 0
                   if (!ret) {
                       ^~~~
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1163:3: note: Taking false branch
                   if (!ret) {
                   ^
   drivers/gpu/drm/etnaviv/etnaviv_gpu.c:1158:2: note: Loop condition is false. Execution continues on line 1172
           for (i = 0; i < nr_events; i++) {
--
           usbhs_lock(priv, flags);
           ^
   drivers/usb/renesas_usbhs/common.h:294:26: note: expanded from macro 'usbhs_lock'
   #define usbhs_lock(p, f) spin_lock_irqsave(usbhs_priv_to_lock(p), f)
                            ^
   include/linux/spinlock.h:393:2: note: expanded from macro 'spin_lock_irqsave'
           raw_spin_lock_irqsave(spinlock_check(lock), flags);     \
           ^
   include/linux/spinlock.h:276:2: note: expanded from macro 'raw_spin_lock_irqsave'
           do {                                            \
           ^
   drivers/usb/renesas_usbhs/mod.c:199:2: note: Loop condition is false.  Exiting loop
           usbhs_lock(priv, flags);
           ^
   drivers/usb/renesas_usbhs/common.h:294:26: note: expanded from macro 'usbhs_lock'
   #define usbhs_lock(p, f) spin_lock_irqsave(usbhs_priv_to_lock(p), f)
                            ^
   include/linux/spinlock.h:391:43: note: expanded from macro 'spin_lock_irqsave'
   #define spin_lock_irqsave(lock, flags)                          \
                                                                   ^
   drivers/usb/renesas_usbhs/mod.c:203:2: note: Taking false branch
           if (usbhs_mod_is_host(priv)) {
           ^
   drivers/usb/renesas_usbhs/mod.c:211:6: note: Assuming 'mod' is null
           if (mod) {
               ^~~
   drivers/usb/renesas_usbhs/mod.c:211:2: note: Taking false branch
           if (mod) {
           ^
   drivers/usb/renesas_usbhs/mod.c:226:6: note: Assuming the condition is true
           if (priv->irqflags & IRQF_SHARED) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/renesas_usbhs/mod.c:226:2: note: Taking true branch
           if (priv->irqflags & IRQF_SHARED) {
           ^
   drivers/usb/renesas_usbhs/mod.c:227:7: note: Assuming the condition is true
                   if (!(intenb0 & state->intsts0) &&
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/renesas_usbhs/mod.c:227:7: note: Left side of '&&' is true
   drivers/usb/renesas_usbhs/mod.c:227:7: note: Left side of '&&' is true
   drivers/usb/renesas_usbhs/mod.c:229:7: note: Branch condition evaluates to a garbage value
                       !(state->bempsts) &&
                       ^~~~~~~~~~~~~~~~~
   drivers/usb/renesas_usbhs/mod.c:271:3: warning: 3rd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
                   usbhs_write(priv, BRDYSTS, ~irq_state.brdysts);
                   ^                          ~~~~~~~~~~~~~~~~~~
   drivers/usb/renesas_usbhs/mod.c:247:2: note: Taking false branch
           if (usbhs_status_get_each_irq(priv, &irq_state) < 0)
           ^
   drivers/usb/renesas_usbhs/mod.c:262:2: note: Taking false branch
           if (usbhs_mod_is_host(priv))
           ^
   drivers/usb/renesas_usbhs/mod.c:270:6: note: Assuming the condition is true
           if (irq_state.intsts0 & BRDY)
               ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/renesas_usbhs/mod.c:270:2: note: Taking true branch
           if (irq_state.intsts0 & BRDY)
           ^
   drivers/usb/renesas_usbhs/mod.c:271:3: note: 3rd function call argument is an uninitialized value
                   usbhs_write(priv, BRDYSTS, ~irq_state.brdysts);
                   ^                          ~~~~~~~~~~~~~~~~~~
   drivers/usb/renesas_usbhs/mod.c:272:2: warning: 3rd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
           usbhs_write(priv, NRDYSTS, ~irq_state.nrdysts);
           ^                          ~~~~~~~~~~~~~~~~~~
   drivers/usb/renesas_usbhs/mod.c:247:2: note: Taking false branch
           if (usbhs_status_get_each_irq(priv, &irq_state) < 0)
           ^
   drivers/usb/renesas_usbhs/mod.c:262:2: note: Taking false branch
           if (usbhs_mod_is_host(priv))
           ^
   drivers/usb/renesas_usbhs/mod.c:270:6: note: Assuming the condition is false
           if (irq_state.intsts0 & BRDY)
               ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/renesas_usbhs/mod.c:270:2: note: Taking false branch
           if (irq_state.intsts0 & BRDY)
           ^
   drivers/usb/renesas_usbhs/mod.c:272:2: note: 3rd function call argument is an uninitialized value
           usbhs_write(priv, NRDYSTS, ~irq_state.nrdysts);
           ^                          ~~~~~~~~~~~~~~~~~~
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   9 warnings generated.
>> drivers/gpu/drm/sun4i/sun4i_tcon.c:1426:2: warning: Value stored to 'id' is never read [clang-analyzer-deadcode.DeadStores]
           id = sun4i_tcon_of_get_id_from_port(port);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/sun4i/sun4i_tcon.c:1426:2: note: Value stored to 'id' is never read
           id = sun4i_tcon_of_get_id_from_port(port);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   10 warnings generated.
   drivers/gpu/drm/sun4i/sun4i_tv.c:491:3: 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(mode->name, tv_mode->name);
                   ^~~~~~
   drivers/gpu/drm/sun4i/sun4i_tv.c:491:3: 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(mode->name, tv_mode->name);
                   ^~~~~~
   Suppressed 9 warnings (8 in non-user code, 1 with check filters).
   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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   10 warnings generated.
   drivers/regulator/mt6380-regulator.c:200:6: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
           val <<= ffs(info->modeset_mask) - 1;
               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6380-regulator.c:189:2: note: Control jumps to 'case 1:'  at line 193
           switch (mode) {
           ^
   drivers/regulator/mt6380-regulator.c:195:3: note:  Execution continues on line 200
                   break;
                   ^
   drivers/regulator/mt6380-regulator.c:200:6: note: Assigned value is garbage or undefined
           val <<= ffs(info->modeset_mask) - 1;
               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6380-regulator.c:220:6: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
           val >>= ffs(info->modeset_mask) - 1;
               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6380-regulator.c:216:6: note: Assuming 'ret' is >= 0
           if (ret < 0)
               ^~~~~~~
   drivers/regulator/mt6380-regulator.c:216:2: note: Taking false branch
           if (ret < 0)
           ^
   drivers/regulator/mt6380-regulator.c:220:6: note: Assigned value is garbage or undefined
           val >>= ffs(info->modeset_mask) - 1;
               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   12 warnings generated.
   drivers/usb/typec/tcpm/tcpm.c:297:8: warning: Excessive padding in 'struct tcpm_port' (44 padding bytes, where 4 is optimal). 
   Optimal fields order: 
   delayed_runtime, 
   state_machine_timer, 
   vdm_state_machine_timer, 
   enable_frs_timer, 
   send_discover_timer, 
   dev, 
   wq, 
   typec_port, 
   tcpc, 
   role_sw, 
   vconn_role, 
   pwr_role, 
   data_role, 
   pwr_opmode, 
   partner, 
   cc_req, 
   src_rp, 
   cc1, 
   cc2, 
   polarity, 
   port_type, 
--
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/lpass-rx-macro.c:1509:7: note: Taking false branch
           else if (e->reg == CDC_RX_RX1_RX_PATH_CFG1)
                ^
   sound/soc/codecs/lpass-rx-macro.c:1513:6: note: Assuming 'val' is 0
           if (val)
               ^~~
   sound/soc/codecs/lpass-rx-macro.c:1513:2: note: Taking false branch
           if (val)
           ^
   sound/soc/codecs/lpass-rx-macro.c:1518:3: note: 2nd function call argument is an uninitialized value
                   snd_soc_component_update_bits(component, look_ahead_dly_reg,
                   ^                                        ~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/lpass-rx-macro.c:2224:6: warning: Branch condition evaluates to a garbage value [clang-analyzer-core.uninitialized.Branch]
           if (hd2_enable_reg && SND_SOC_DAPM_EVENT_ON(event)) {
               ^
   sound/soc/codecs/lpass-rx-macro.c:2617:2: note: Control jumps to 'case 1:'  at line 2618
           switch (event) {
           ^
   sound/soc/codecs/lpass-rx-macro.c:2619:3: note: Calling 'rx_macro_enable_interp_clk'
                   rx_macro_enable_interp_clk(component, event, w->shift);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/lpass-rx-macro.c:2513:6: note: Assuming 'interp_idx' is not equal to INTERP_AUX
           if (interp_idx == INTERP_AUX)
               ^~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/lpass-rx-macro.c:2513:2: note: Taking false branch
           if (interp_idx == INTERP_AUX)
           ^
   sound/soc/codecs/lpass-rx-macro.c:2517:2: note: Taking true branch
           if (SND_SOC_DAPM_EVENT_ON(event)) {
           ^
   sound/soc/codecs/lpass-rx-macro.c:2518:7: note: Assuming the condition is true
                   if (rx->main_clk_users[interp_idx] == 0) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/lpass-rx-macro.c:2518:3: note: Taking true branch
                   if (rx->main_clk_users[interp_idx] == 0) {
                   ^
   sound/soc/codecs/lpass-rx-macro.c:2527:8: note: Assuming field 'hph_hd2_mode' is true
                           if (rx->hph_hd2_mode)
                               ^~~~~~~~~~~~~~~~
   sound/soc/codecs/lpass-rx-macro.c:2527:4: note: Taking true branch
                           if (rx->hph_hd2_mode)
                           ^
   sound/soc/codecs/lpass-rx-macro.c:2528:5: note: Calling 'rx_macro_hd2_control'
                                   rx_macro_hd2_control(component, interp_idx, event);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/lpass-rx-macro.c:2211:21: note: 'hd2_enable_reg' declared without an initial value
           u16 hd2_scale_reg, hd2_enable_reg;
                              ^~~~~~~~~~~~~~
   sound/soc/codecs/lpass-rx-macro.c:2213:2: note: 'Default' branch taken. Execution continues on line 2224
           switch (interp_idx) {
           ^
   sound/soc/codecs/lpass-rx-macro.c:2224:6: note: Branch condition evaluates to a garbage value
           if (hd2_enable_reg && SND_SOC_DAPM_EVENT_ON(event)) {
               ^~~~~~~~~~~~~~
   Suppressed 8 warnings (8 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.
   12 warnings generated.
   drivers/media/platform/exynos4-is/fimc-capture.c:670:16: warning: Division by zero [clang-analyzer-core.DivideZero]
                   align_sz = 64/ALIGN(depth, 8);
                                ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1643:6: note: Assuming field 'pad' is not equal to FIMC_SD_PAD_SOURCE
           if (sel->pad == FIMC_SD_PAD_SOURCE)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:1643:2: note: Taking false branch
           if (sel->pad == FIMC_SD_PAD_SOURCE)
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1647:2: note: Calling 'fimc_capture_try_selection'
           fimc_capture_try_selection(ctx, r, V4L2_SEL_TGT_CROP);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:643:16: note: Assuming field 'rotation' is equal to 90
           bool rotate = ctx->rotation == 90 || ctx->rotation == 270;
                         ^~~~~~~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:643:36: note: Left side of '||' is true
           bool rotate = ctx->rotation == 90 || ctx->rotation == 270;
                                             ^
   drivers/media/platform/exynos4-is/fimc-capture.c:653:6: note: Assuming the condition is true
           if (fimc_fmt_is_user_defined(ctx->d_frame.fmt->color)) {
               ^
   drivers/media/platform/exynos4-is/fimc-core.h:112:39: note: expanded from macro 'fimc_fmt_is_user_defined'
   #define fimc_fmt_is_user_defined(x) (!!((x) & 0x180))
                                         ^~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:653:2: note: Taking false branch
           if (fimc_fmt_is_user_defined(ctx->d_frame.fmt->color)) {
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:659:6: note: 'target' is not equal to V4L2_SEL_TGT_COMPOSE
           if (target == V4L2_SEL_TGT_COMPOSE) {
               ^~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:659:2: note: Taking false branch
           if (target == V4L2_SEL_TGT_COMPOSE) {
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:670:16: note: Division by zero
                   align_sz = 64/ALIGN(depth, 8);
                              ~~^~~~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:825:3: warning: Value stored to 'ffmt' is never read [clang-analyzer-deadcode.DeadStores]
                   ffmt = fimc_capture_try_format(ctx, &tfmt->width, &tfmt->height,
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:825:3: note: Value stored to 'ffmt' is never read
                   ffmt = fimc_capture_try_format(ctx, &tfmt->width, &tfmt->height,
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/exynos4-is/fimc-capture.c:862:22: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
                   fd.entry[i].length = plane_fmt[i].sizeimage;
                                      ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1184:2: note: Taking false branch
           if (fimc_capture_active(fimc))
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1188:6: note: Assuming 'ret' is >= 0
           if (ret < 0)
               ^~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:1188:2: note: Taking false branch
           if (ret < 0)
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1192:6: note: Assuming 'sd' is non-null
           if (sd)
               ^~
   drivers/media/platform/exynos4-is/fimc-capture.c:1192:2: note: Taking true branch
           if (sd)
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1195:6: note: Assuming 'si' is not equal to NULL
           if (si == NULL) {
               ^~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:1195:2: note: Taking false branch
           if (si == NULL) {
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1205:6: note: Assuming the condition is false
           if (vc->input == GRP_ID_FIMC_IS)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:1205:2: note: Taking false branch
           if (vc->input == GRP_ID_FIMC_IS)
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1208:6: note: Assuming field 'user_subdev_api' is true
           if (vc->user_subdev_api) {
               ^~~~~~~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:1208:2: note: Taking true branch
           if (vc->user_subdev_api) {
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1209:9: note: Calling 'fimc_pipeline_validate'
                   ret = fimc_pipeline_validate(fimc);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:1101:28: note: Left side of '&&' is false
           struct fimc_pipeline *p = to_fimc_pipeline(vc->ve.pipe);
                                     ^
   drivers/media/platform/exynos4-is/media-dev.h:62:31: note: expanded from macro 'to_fimc_pipeline'
   #define to_fimc_pipeline(_ep) container_of(_ep, struct fimc_pipeline, ep)
                                 ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1101:28: note: Taking false branch
           struct fimc_pipeline *p = to_fimc_pipeline(vc->ve.pipe);
                                     ^
   drivers/media/platform/exynos4-is/media-dev.h:62:31: note: expanded from macro 'to_fimc_pipeline'
   #define to_fimc_pipeline(_ep) container_of(_ep, struct fimc_pipeline, ep)
                                 ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:302:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1101:28: note: Loop condition is false.  Exiting loop
           struct fimc_pipeline *p = to_fimc_pipeline(vc->ve.pipe);
                                     ^
   drivers/media/platform/exynos4-is/media-dev.h:62:31: note: expanded from macro 'to_fimc_pipeline'
   #define to_fimc_pipeline(_ep) container_of(_ep, struct fimc_pipeline, ep)
                                 ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1105:2: note: Loop condition is true.  Entering loop body
           while (1) {
           ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1113:15: note: Assuming 'i' is < field 'num_pads'
                   for (i = 0; i < sd->entity.num_pads; i++) {
                               ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/exynos4-is/fimc-capture.c:1113:3: note: Loop condition is true.  Entering loop body
                   for (i = 0; i < sd->entity.num_pads; i++) {
                   ^
   drivers/media/platform/exynos4-is/fimc-capture.c:1116:8: note: Assuming the condition is true
                           if (p->flags & MEDIA_PAD_FL_SINK) {

vim +154 arch/arm/mach-ep93xx/clock.c

ff05c0330b9880f Hartley Sweeten 2009-05-07  125  
9645ccc7bd7a16c Nikita Shubin   2021-10-18  126  static struct clk_hw *ep93xx_clk_register_gate(const char *name,
9645ccc7bd7a16c Nikita Shubin   2021-10-18  127  				    const char *parent_name,
9645ccc7bd7a16c Nikita Shubin   2021-10-18  128  				    void __iomem *reg,
9645ccc7bd7a16c Nikita Shubin   2021-10-18  129  				    u8 bit_idx)
9645ccc7bd7a16c Nikita Shubin   2021-10-18  130  {
9645ccc7bd7a16c Nikita Shubin   2021-10-18  131  	struct clk_init_data init;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  132  	struct clk_psc *psc;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  133  	struct clk *clk;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  134  
9645ccc7bd7a16c Nikita Shubin   2021-10-18  135  	psc = kzalloc(sizeof(*psc), GFP_KERNEL);
9645ccc7bd7a16c Nikita Shubin   2021-10-18  136  	if (!psc)
9645ccc7bd7a16c Nikita Shubin   2021-10-18  137  		return ERR_PTR(-ENOMEM);
9645ccc7bd7a16c Nikita Shubin   2021-10-18  138  
9645ccc7bd7a16c Nikita Shubin   2021-10-18  139  	init.name = name;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  140  	init.ops = &clk_ep93xx_gate_ops;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  141  	init.flags = CLK_SET_RATE_PARENT;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  142  	init.parent_names = (parent_name ? &parent_name : NULL);
9645ccc7bd7a16c Nikita Shubin   2021-10-18  143  	init.num_parents = (parent_name ? 1 : 0);
9645ccc7bd7a16c Nikita Shubin   2021-10-18  144  
9645ccc7bd7a16c Nikita Shubin   2021-10-18  145  	psc->reg = reg;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  146  	psc->bit_idx = bit_idx;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  147  	psc->hw.init = &init;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  148  	psc->lock = &clk_lock;
9645ccc7bd7a16c Nikita Shubin   2021-10-18  149  
9645ccc7bd7a16c Nikita Shubin   2021-10-18  150  	clk = clk_register(NULL, &psc->hw);
9645ccc7bd7a16c Nikita Shubin   2021-10-18  151  	if (IS_ERR(clk))
9645ccc7bd7a16c Nikita Shubin   2021-10-18  152  		kfree(psc);
9645ccc7bd7a16c Nikita Shubin   2021-10-18  153  
9645ccc7bd7a16c Nikita Shubin   2021-10-18 @154  	return &psc->hw;
ff05c0330b9880f Hartley Sweeten 2009-05-07  155  }
ff05c0330b9880f Hartley Sweeten 2009-05-07  156  

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
@ 2021-11-28  0:02 kernel test robot
  0 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2021-11-28  0:02 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nikita Shubin <nikita.shubin@maquefel.me>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Alexander Sverdlin <alexander.sverdlin@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   86799cdfbcd2308cbad6c1dc983b81595b77b639
commit: 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert in-place to COMMON_CLK
date:   5 weeks ago
:::::: branch date: 5 hours ago
:::::: commit date: 5 weeks ago
config: arm-randconfig-c002-20211123 (https://download.01.org/0day-ci/archive/20211128/202111280749.yGbKIaes-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 49e3838145dff1ec91c2e67a2cb562775c8d2a08)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 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 >>)
               ^
   include/linux/compiler.h:78:40: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                             ^~~~
   include/linux/uaccess.h:161:2: note: Taking true branch
           if (unlikely(res))
           ^
   include/linux/uaccess.h:192:7: note: Returning from '_copy_from_user'
                   n = _copy_from_user(to, from, n);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/kernel/sys_oabi-compat.c:357:10: note: Returning from 'copy_from_user'
                   err |= copy_from_user(&osb, tsops, sizeof(osb));
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/kernel/sys_oabi-compat.c:355:14: note: Assuming 'i' is < 'nsops'
           for (i = 0; i < nsops; i++) {
                       ^~~~~~~~~
   arch/arm/kernel/sys_oabi-compat.c:355:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < nsops; i++) {
           ^
   arch/arm/kernel/sys_oabi-compat.c:357:10: note: Calling 'copy_from_user'
                   err |= copy_from_user(&osb, tsops, sizeof(osb));
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:191:2: note: Taking true branch
           if (likely(check_copy_size(to, n, false)))
           ^
   include/linux/uaccess.h:192:7: note: Calling '_copy_from_user'
                   n = _copy_from_user(to, from, n);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:157:6: note: Left side of '&&' is true
           if (!should_fail_usercopy() && likely(access_ok(from, n))) {
               ^
   include/linux/uaccess.h:157:33: note: Assuming the condition is false
           if (!should_fail_usercopy() && likely(access_ok(from, n))) {
                                          ^
   include/linux/compiler.h:77:20: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:157:2: note: Taking false branch
           if (!should_fail_usercopy() && likely(access_ok(from, n))) {
           ^
   include/linux/uaccess.h:161:2: note: Taking true branch
           if (unlikely(res))
           ^
   include/linux/uaccess.h:192:7: note: Returning from '_copy_from_user'
                   n = _copy_from_user(to, from, n);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/kernel/sys_oabi-compat.c:357:10: note: Returning from 'copy_from_user'
                   err |= copy_from_user(&osb, tsops, sizeof(osb));
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/kernel/sys_oabi-compat.c:360:3: note: Uninitialized value stored to 'osb.sem_num'
                   sops[i].sem_flg = osb.sem_flg;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/kernel/sys_oabi-compat.c:355:14: note: Assuming 'i' is < 'nsops'
           for (i = 0; i < nsops; i++) {
                       ^~~~~~~~~
   arch/arm/kernel/sys_oabi-compat.c:355:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < nsops; i++) {
           ^
   arch/arm/kernel/sys_oabi-compat.c:357:10: note: Calling 'copy_from_user'
                   err |= copy_from_user(&osb, tsops, sizeof(osb));
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:191:6: note: Assuming the condition is true
           if (likely(check_copy_size(to, n, false)))
               ^
   include/linux/compiler.h:77:38: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                                             ^~~~
   include/linux/uaccess.h:191:2: note: Taking false branch
           if (likely(check_copy_size(to, n, false)))
           ^
   include/linux/uaccess.h:193:2: note: Returning without writing to 'to->sem_num'
           return n;
           ^
   arch/arm/kernel/sys_oabi-compat.c:357:10: note: Returning from 'copy_from_user'
                   err |= copy_from_user(&osb, tsops, sizeof(osb));
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/kernel/sys_oabi-compat.c:358:19: note: Assigned value is garbage or undefined
                   sops[i].sem_num = osb.sem_num;
                                   ^ ~~~~~~~~~~~
   Suppressed 23 warnings (9 in non-user code, 14 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
>> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:579:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
           ^
   arch/arm/mach-ep93xx/clock.c:627:6: note: Assuming the condition is false
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:627:2: note: Taking false branch
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
           ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Loop condition is false.  Exiting loop
           pr_info("PLL1 running at %ld MHz, PLL2@%ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Loop condition is false.  Exiting loop
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:642:2: note: Calling 'ep93xx_uart_clock_init'
           ep93xx_uart_clock_init();
           ^~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:479:6: note: Assuming the condition is false
           if (value & EP93XX_SYSCON_PWRCNT_UARTBAUD)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:479:2: note: Taking false branch
           if (value & EP93XX_SYSCON_PWRCNT_UARTBAUD)
           ^
   arch/arm/mach-ep93xx/clock.c:487:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < ARRAY_SIZE(ep93xx_uarts); i++) {
           ^
   arch/arm/mach-ep93xx/clock.c:488:8: note: Calling 'ep93xx_clk_register_gate'
                   hw = ep93xx_clk_register_gate(ep93xx_uarts[i].dev_id,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:136:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:136:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:142:23: note: 'parent_name' is non-null
           init.parent_names = (parent_name ? &parent_name : NULL);
                                ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:142:23: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:143:22: note: 'parent_name' is non-null
           init.num_parents = (parent_name ? 1 : 0);
                               ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:143:22: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:349:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:686:7: note: Calling 'clk_hw_register_ddiv'
           hw = clk_hw_register_ddiv("ep93xx-fb",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:331:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:331:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:346:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:347:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:349:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:456:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:579:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
           ^
   arch/arm/mach-ep93xx/clock.c:627:6: note: Assuming the condition is false
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:627:2: note: Taking false branch
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
           ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Loop condition is false.  Exiting loop
           pr_info("PLL1 running at %ld MHz, PLL2@%ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Loop condition is false.  Exiting loop
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:645:7: note: Calling 'clk_hw_register_div'
           hw = clk_hw_register_div("ep93xx-adc",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:434:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:434:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:440:23: note: 'parent_name' is non-null
           init.parent_names = (parent_name ? &parent_name : NULL);
                                ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:440:23: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:453:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:454:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:456:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
>> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:484:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   12 warnings generated.
   security/smack/smackfs.c:1194:3: warning: Value stored to 'm' is never read [clang-analyzer-deadcode.DeadStores]
                   m = BEBITS;
                   ^
   security/smack/smackfs.c:1194:3: note: Value stored to 'm' is never read
   security/smack/smackfs.c:2312:9: warning: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
                   res = smk_access(rule.smk_subject, rule.smk_object,
                         ^
   security/smack/smackfs.c:2340:9: note: Calling 'smk_user_access'
           return smk_user_access(file, buf, count, ppos, SMK_FIXED24_FMT);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/smack/smackfs.c:2297:6: note: Calling 'IS_ERR'
           if (IS_ERR(data))
               ^~~~~~~~~~~~
   include/linux/err.h:36:9: note: Assuming the condition is false
           return IS_ERR_VALUE((unsigned long)ptr);
                  ^
   include/linux/err.h:22:34: note: expanded from macro 'IS_ERR_VALUE'
   #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/err.h:36:2: note: Returning zero, which participates in a condition later
           return IS_ERR_VALUE((unsigned long)ptr);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/smack/smackfs.c:2297:6: note: Returning from 'IS_ERR'
           if (IS_ERR(data))
               ^~~~~~~~~~~~
   security/smack/smackfs.c:2297:2: note: Taking false branch
           if (IS_ERR(data))
           ^
   security/smack/smackfs.c:2300:6: note: 'format' is equal to SMK_FIXED24_FMT
           if (format == SMK_FIXED24_FMT) {
               ^~~~~~
   security/smack/smackfs.c:2300:2: note: Taking true branch
           if (format == SMK_FIXED24_FMT) {
           ^
   security/smack/smackfs.c:2301:7: note: Assuming the condition is false
                   if (count < SMK_LOADLEN)
                       ^~~~~~~~~~~~~~~~~~~
   security/smack/smackfs.c:2301:3: note: Taking false branch
                   if (count < SMK_LOADLEN)
                   ^
   security/smack/smackfs.c:2303:9: note: Calling 'smk_parse_rule'
                   res = smk_parse_rule(data, &rule, 0);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/smack/smackfs.c:372:7: note: Calling 'smk_fill_rule'
           rc = smk_fill_rule(data, data + SMK_LABELLEN,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/smack/smackfs.c:322:6: note: 'import' is 0
           if (import) {
               ^~~~~~
   security/smack/smackfs.c:322:2: note: Taking false branch
           if (import) {
           ^
   security/smack/smackfs.c:332:3: note: Taking true branch
                   if (IS_ERR(cp))
                   ^
   security/smack/smackfs.c:333:4: note: Returning without writing to 'rule->smk_subject'
                           return PTR_ERR(cp);
                           ^
   security/smack/smackfs.c:372:7: note: Returning from 'smk_fill_rule'
           rc = smk_fill_rule(data, data + SMK_LABELLEN,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/smack/smackfs.c:375:2: note: Returning without writing to 'rule->smk_subject'
           return rc;
           ^
   security/smack/smackfs.c:2303:9: note: Returning from 'smk_parse_rule'
                   res = smk_parse_rule(data, &rule, 0);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/smack/smackfs.c:2311:6: note: 'res' is >= 0
           if (res >= 0)
               ^~~
   security/smack/smackfs.c:2311:2: note: Taking true branch
           if (res >= 0)
           ^
   security/smack/smackfs.c:2312:9: note: 1st function call argument is an uninitialized value
                   res = smk_access(rule.smk_subject, rule.smk_object,
                         ^          ~~~~~~~~~~~~~~~~
   security/smack/smackfs.c:2312:9: warning: 2nd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
                   res = smk_access(rule.smk_subject, rule.smk_object,
                         ^
   security/smack/smackfs.c:2340:9: note: Calling 'smk_user_access'
           return smk_user_access(file, buf, count, ppos, SMK_FIXED24_FMT);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/smack/smackfs.c:2297:6: note: Calling 'IS_ERR'
--
           ^
   include/linux/rcupdate.h:587:2: note: expanded from macro 'rcu_dereference_protected'
           __rcu_dereference_protected((p), (c), __rcu)
           ^
   include/linux/rcupdate.h:396:2: note: expanded from macro '__rcu_dereference_protected'
           RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
           ^
   include/linux/rcupdate.h:318:11: note: expanded from macro 'RCU_LOCKDEP_WARN'
                   if ((c) && debug_lockdep_rcu_enabled() && !__warned) {  \
                           ^
   security/keys/process_keys.c:78:35: note: Loop condition is false.  Exiting loop
           struct user_namespace *user_ns = current_user_ns();
                                            ^
   include/linux/cred.h:395:28: note: expanded from macro 'current_user_ns'
   #define current_user_ns()       (current_cred_xxx(user_ns))
                                    ^
   include/linux/cred.h:378:2: note: expanded from macro 'current_cred_xxx'
           current_cred()->xxx;                    \
           ^
   include/linux/cred.h:299:2: note: expanded from macro 'current_cred'
           rcu_dereference_protected(current->cred, 1)
           ^
   include/linux/rcupdate.h:587:2: note: expanded from macro 'rcu_dereference_protected'
           __rcu_dereference_protected((p), (c), __rcu)
           ^
   include/linux/rcupdate.h:396:2: note: expanded from macro '__rcu_dereference_protected'
           RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
           ^
   include/linux/rcupdate.h:316:2: note: expanded from macro 'RCU_LOCKDEP_WARN'
           do {                                                            \
           ^
   security/keys/process_keys.c:88:2: note: Taking false branch
           kenter("%u", uid);
           ^
   security/keys/internal.h:34:2: note: expanded from macro 'kenter'
           no_printk(KERN_DEBUG "==> %s("FMT")\n", __func__, ##__VA_ARGS__)
           ^
   include/linux/printk.h:131:2: note: expanded from macro 'no_printk'
           if (0)                                          \
           ^
   security/keys/process_keys.c:91:2: note: Taking true branch
           if (IS_ERR(reg_keyring))
           ^
   security/keys/process_keys.c:92:3: note: Returning without writing to '*_user_session_keyring'
                   return PTR_ERR(reg_keyring);
                   ^
   security/keys/process_keys.c:704:9: note: Returning from 'look_up_user_keyrings'
                   ret = look_up_user_keyrings(NULL, &key);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/process_keys.c:705:7: note: 'ret' is >= 0
                   if (ret < 0)
                       ^~~
   security/keys/process_keys.c:705:3: note: Taking false branch
                   if (ret < 0)
                   ^
   security/keys/process_keys.c:707:13: note: 1st function call argument is an uninitialized value
                   key_ref = make_key_ref(key, 1);
                             ^            ~~~
   Suppressed 8 warnings (8 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/clk/socfpga/clk-periph.c:69:41: warning: The right operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
           periph_clk->hw.reg = clk_mgr_base_addr + reg;
                                                  ^
   drivers/clk/socfpga/clk-periph.c:108:2: note: Calling '__socfpga_periph_init'
           __socfpga_periph_init(node, &periclk_ops);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/socfpga/clk-periph.c:53:2: note: 'reg' declared without an initial value
           u32 reg;
           ^~~~~~~
   drivers/clk/socfpga/clk-periph.c:63:2: note: Calling 'of_property_read_u32'
           of_property_read_u32(node, "reg", &reg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/of.h:1256:9: note: Calling 'of_property_read_u32_array'
           return of_property_read_u32_array(np, propname, out_value, 1);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/of.h:752:2: note: Returning without writing to '*out_values'
           return -ENOSYS;
           ^
   include/linux/of.h:1256:9: note: Returning from 'of_property_read_u32_array'
           return of_property_read_u32_array(np, propname, out_value, 1);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/of.h:1256:2: note: Returning without writing to '*out_value'
           return of_property_read_u32_array(np, propname, out_value, 1);
           ^
   drivers/clk/socfpga/clk-periph.c:63:2: note: Returning from 'of_property_read_u32'
           of_property_read_u32(node, "reg", &reg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/socfpga/clk-periph.c:66:14: note: Assuming 'periph_clk' is non-null
           if (WARN_ON(!periph_clk))
                       ^
   include/asm-generic/bug.h:166:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   drivers/clk/socfpga/clk-periph.c:66:2: note: Taking false branch
           if (WARN_ON(!periph_clk))
           ^
   drivers/clk/socfpga/clk-periph.c:69:41: note: The right operand of '+' is a garbage value
           periph_clk->hw.reg = clk_mgr_base_addr + reg;
                                                  ^ ~~~
>> drivers/clk/socfpga/clk-periph.c:103:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
           rc = of_clk_add_provider(node, of_clk_src_simple_get, hw_clk);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/socfpga/clk-periph.c:103:2: note: Value stored to 'rc' is never read
           rc = of_clk_add_provider(node, of_clk_src_simple_get, hw_clk);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   lib/assoc_array.c:97:3: warning: Value stored to 'cursor' is never read [clang-analyzer-deadcode.DeadStores]
                   cursor = parent;
                   ^        ~~~~~~
   lib/assoc_array.c:97:3: note: Value stored to 'cursor' is never read
                   cursor = parent;
                   ^        ~~~~~~
   lib/assoc_array.c:409:3: warning: Value stored to 'cursor' is never read [clang-analyzer-deadcode.DeadStores]
                   cursor = parent;
                   ^        ~~~~~~
   lib/assoc_array.c:409:3: note: Value stored to 'cursor' is never read
                   cursor = parent;
                   ^        ~~~~~~
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   drivers/clk/ingenic/cgu.c:512:10: warning: Division by zero [clang-analyzer-core.DivideZero]
                   rate = DIV_ROUND_UP(parent_rate, div);
                          ^
   include/linux/math.h:36:22: note: expanded from macro 'DIV_ROUND_UP'
   #define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP
                        ^
   include/uapi/linux/const.h:34:54: note: expanded from macro '__KERNEL_DIV_ROUND_UP'
   #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
                                        ~~~~~~~~~~~~~~~~^~~~~
   drivers/clk/ingenic/cgu.c:502:36: note: Left side of '&&' is false
           struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
                                             ^
   drivers/clk/ingenic/cgu.h:210:29: note: expanded from macro 'to_ingenic_clk'
   #define to_ingenic_clk(_hw) container_of(_hw, struct ingenic_clk, hw)
                               ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/clk/ingenic/cgu.c:502:36: note: Taking false branch
           struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
                                             ^
   drivers/clk/ingenic/cgu.h:210:29: note: expanded from macro 'to_ingenic_clk'
   #define to_ingenic_clk(_hw) container_of(_hw, struct ingenic_clk, hw)
                               ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
--
           for (;;) {
           ^
   drivers/gpu/drm/drm_file.c:584:7: note: Assuming the condition is true
                   if (!list_empty(&file_priv->event_list)) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/drm_file.c:584:3: note: Taking true branch
                   if (!list_empty(&file_priv->event_list)) {
                   ^
   drivers/gpu/drm/drm_file.c:585:8: note: Left side of '&&' is false
                           e = list_first_entry(&file_priv->event_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:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/gpu/drm/drm_file.c:585:8: note: Taking false branch
                           e = list_first_entry(&file_priv->event_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:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:302:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/gpu/drm/drm_file.c:585:8: note: Loop condition is false.  Exiting loop
                           e = list_first_entry(&file_priv->event_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:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/gpu/drm/drm_file.c:587:30: note: Use of memory after it is freed
                           file_priv->event_space += e->event->length;
                                                     ^~~~~~~~
   Suppressed 9 warnings (9 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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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/clk/socfpga/clk-gate.c:37:10: warning: Although the value stored to 'l4_src' is used in the enclosing expression, the value is never actually read from 'l4_src' [clang-analyzer-deadcode.DeadStores]
                   return l4_src &= 0x1;
                          ^         ~~~
   drivers/clk/socfpga/clk-gate.c:37:10: note: Although the value stored to 'l4_src' is used in the enclosing expression, the value is never actually read from 'l4_src'
                   return l4_src &= 0x1;
                          ^         ~~~
>> drivers/clk/socfpga/clk-gate.c:46:10: warning: Although the value stored to 'perpll_src' is used in the enclosing expression, the value is never actually read from 'perpll_src' [clang-analyzer-deadcode.DeadStores]
                   return perpll_src &= 0x3;
                          ^             ~~~
   drivers/clk/socfpga/clk-gate.c:46:10: note: Although the value stored to 'perpll_src' is used in the enclosing expression, the value is never actually read from 'perpll_src'
                   return perpll_src &= 0x3;
                          ^             ~~~
   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.
   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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   11 warnings generated.
   crypto/testmgr.c:286:8: warning: Excessive padding in 'struct testvec_config' (8 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   name, 
   req_flags, 
   iv_offset, 
   key_offset, 
   finalization_type, 
   src_divs, 
   dst_divs, 
   inplace, 
   iv_offset_relative_to_alignmask, 
   key_offset_relative_to_alignmask, 
   nosimd, 
   consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct testvec_config {
   ~~~~~~~^~~~~~~~~~~~~~~~
   crypto/testmgr.c:286:8: note: Excessive padding in 'struct testvec_config' (8 padding bytes, where 0 is optimal). Optimal fields order: name, req_flags, iv_offset, key_offset, finalization_type, src_divs, dst_divs, inplace, iv_offset_relative_to_alignmask, key_offset_relative_to_alignmask, nosimd, consider reordering the fields or adding explicit padding members
   struct testvec_config {
   ~~~~~~~^~~~~~~~~~~~~~~~
   crypto/testmgr.c:601:25: warning: Access to field 'offset' results in a dereference of an undefined pointer value (loaded from field 'div') [clang-analyzer-core.NullDereference]
                   unsigned int offset = partitions[i].div->offset;
                                         ^
   crypto/testmgr.c:2697:19: note: Assuming 'enc' is 0
           const char *op = enc ? "encryption" : "decryption";
                            ^~~
   crypto/testmgr.c:2697:19: note: '?' condition is false
   crypto/testmgr.c:2702:5: note: Assuming field 'iv_offset_relative_to_alignmask' is false
                    (cfg->iv_offset_relative_to_alignmask ? alignmask : 0);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   crypto/testmgr.c:2702:5: note: '?' condition is false
   crypto/testmgr.c:2707:6: note: Assuming field 'wk' is 0
           if (vec->wk)
               ^~~~~~~
   crypto/testmgr.c:2707:2: note: Taking false branch
           if (vec->wk)
           ^
   crypto/testmgr.c:2712:8: note: 'err' is equal to 0
           err = do_setkey(crypto_skcipher_setkey, tfm, vec->key, vec->klen,
                 ^
   crypto/testmgr.c:809:6: note: expanded from macro 'do_setkey'
           if (err == 0) {                                                 \
               ^~~
   crypto/testmgr.c:2712:8: note: Taking true branch
           err = do_setkey(crypto_skcipher_setkey, tfm, vec->key, vec->klen,
                 ^
   crypto/testmgr.c:809:2: note: expanded from macro 'do_setkey'
           if (err == 0) {                                                 \
           ^
   crypto/testmgr.c:2714:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   crypto/testmgr.c:2714:2: note: Taking false branch
           if (err) {
           ^
   crypto/testmgr.c:2722:6: note: Assuming field 'setkey_error' is 0
           if (vec->setkey_error) {
               ^~~~~~~~~~~~~~~~~
   crypto/testmgr.c:2722:2: note: Taking false branch
           if (vec->setkey_error) {
           ^
   crypto/testmgr.c:2729:6: note: Assuming 'ivsize' is 0
           if (ivsize) {
               ^~~~~~
   crypto/testmgr.c:2729:2: note: Taking false branch
           if (ivsize) {
           ^
   crypto/testmgr.c:2739:7: note: Assuming field 'generates_iv' is false
                   if (vec->generates_iv) {
                       ^~~~~~~~~~~~~~~~~
   crypto/testmgr.c:2739:3: note: Taking false branch
                   if (vec->generates_iv) {
                   ^
   crypto/testmgr.c:2748:19: note: 'enc' is 0
           input.iov_base = enc ? (void *)vec->ptext : (void *)vec->ctext;

vim +154 arch/arm/mach-ep93xx/clock.c

ff05c0330b9880 Hartley Sweeten 2009-05-07  125  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct clk_hw *ep93xx_clk_register_gate(const char *name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  127  				    const char *parent_name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  128  				    void __iomem *reg,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  129  				    u8 bit_idx)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  130  {
9645ccc7bd7a16 Nikita Shubin   2021-10-18  131  	struct clk_init_data init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  132  	struct clk_psc *psc;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  133  	struct clk *clk;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  134  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  135  	psc = kzalloc(sizeof(*psc), GFP_KERNEL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  136  	if (!psc)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  137  		return ERR_PTR(-ENOMEM);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  138  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  139  	init.name = name;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  140  	init.ops = &clk_ep93xx_gate_ops;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  141  	init.flags = CLK_SET_RATE_PARENT;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  142  	init.parent_names = (parent_name ? &parent_name : NULL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  143  	init.num_parents = (parent_name ? 1 : 0);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  144  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  145  	psc->reg = reg;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  146  	psc->bit_idx = bit_idx;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  147  	psc->hw.init = &init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  148  	psc->lock = &clk_lock;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  149  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  150  	clk = clk_register(NULL, &psc->hw);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  151  	if (IS_ERR(clk))
9645ccc7bd7a16 Nikita Shubin   2021-10-18  152  		kfree(psc);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  153  
9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154  	return &psc->hw;
ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
ff05c0330b9880 Hartley Sweeten 2009-05-07  156  

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
@ 2021-11-24 22:42 kernel test robot
  0 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2021-11-24 22:42 UTC (permalink / raw)
  To: kbuild

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

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Nikita Shubin <nikita.shubin@maquefel.me>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Alexander Sverdlin <alexander.sverdlin@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5f53fa508db098c9d372423a6dac31c8a5679cdf
commit: 9645ccc7bd7a16cd73c3be9dee70cd702b03be37 ep93xx: clock: convert in-place to COMMON_CLK
date:   5 weeks ago
:::::: branch date: 5 hours ago
:::::: commit date: 5 weeks ago
config: arm-randconfig-c002-20211123 (https://download.01.org/0day-ci/archive/20211125/202111250609.T19mqnCJ-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 49e3838145dff1ec91c2e67a2cb562775c8d2a08)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 9645ccc7bd7a16cd73c3be9dee70cd702b03be37
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 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 >>)
   7 warnings generated.
>> arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:579:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
           ^
   arch/arm/mach-ep93xx/clock.c:627:6: note: Assuming the condition is false
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:627:2: note: Taking false branch
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
           ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Loop condition is false.  Exiting loop
           pr_info("PLL1 running at %ld MHz, PLL2@%ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Loop condition is false.  Exiting loop
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:642:2: note: Calling 'ep93xx_uart_clock_init'
           ep93xx_uart_clock_init();
           ^~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:479:6: note: Assuming the condition is false
           if (value & EP93XX_SYSCON_PWRCNT_UARTBAUD)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:479:2: note: Taking false branch
           if (value & EP93XX_SYSCON_PWRCNT_UARTBAUD)
           ^
   arch/arm/mach-ep93xx/clock.c:487:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < ARRAY_SIZE(ep93xx_uarts); i++) {
           ^
   arch/arm/mach-ep93xx/clock.c:488:8: note: Calling 'ep93xx_clk_register_gate'
                   hw = ep93xx_clk_register_gate(ep93xx_uarts[i].dev_id,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:136:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:136:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:142:23: note: 'parent_name' is non-null
           init.parent_names = (parent_name ? &parent_name : NULL);
                                ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:142:23: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:143:22: note: 'parent_name' is non-null
           init.num_parents = (parent_name ? 1 : 0);
                               ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:143:22: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:349:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:686:7: note: Calling 'clk_hw_register_ddiv'
           hw = clk_hw_register_ddiv("ep93xx-fb",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:331:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:331:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:346:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:347:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:349:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:456:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return &psc->hw;
           ^
   arch/arm/mach-ep93xx/clock.c:553:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:553:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET1_NBYP1))
           ^
   arch/arm/mach-ep93xx/clock.c:579:6: note: Assuming the condition is true
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:579:2: note: Taking true branch
           if (!(value & EP93XX_SYSCON_CLKSET2_NBYP2))
           ^
   arch/arm/mach-ep93xx/clock.c:627:6: note: Assuming the condition is false
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:627:2: note: Taking false branch
           if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
           ^
   arch/arm/mach-ep93xx/clock.c:636:2: note: Loop condition is false.  Exiting loop
           pr_info("PLL1 running at %ld MHz, PLL2@%ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:638:2: note: Loop condition is false.  Exiting loop
           pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
           ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   arch/arm/mach-ep93xx/clock.c:645:7: note: Calling 'clk_hw_register_div'
           hw = clk_hw_register_div("ep93xx-adc",
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:434:6: note: Assuming 'psc' is non-null
           if (!psc)
               ^~~~
   arch/arm/mach-ep93xx/clock.c:434:2: note: Taking false branch
           if (!psc)
           ^
   arch/arm/mach-ep93xx/clock.c:440:23: note: 'parent_name' is non-null
           init.parent_names = (parent_name ? &parent_name : NULL);
                                ^~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:440:23: note: '?' condition is true
   arch/arm/mach-ep93xx/clock.c:453:2: note: Taking true branch
           if (IS_ERR(clk))
           ^
   arch/arm/mach-ep93xx/clock.c:454:3: note: Memory is released
                   kfree(psc);
                   ^~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:456:2: note: Use of memory after it is freed
           return &psc->hw;
           ^      ~~~~~~~~
>> arch/arm/mach-ep93xx/clock.c:484:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:484:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "uart", "xtali", 0, 1, clk_uart_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: warning: Value stored to 'hw' is never read [clang-analyzer-deadcode.DeadStores]
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/clock.c:612:2: note: Value stored to 'hw' is never read
           hw = clk_hw_register_fixed_factor(NULL, "usb_clk", "pll2", 0, 1, clk_usb_div);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   9 warnings generated.
   security/integrity/ima/ima_api.c:108:24: warning: Access to field 'template_desc' results in a dereference of a null pointer (loaded from variable 'entry') [clang-analyzer-core.NullDereference]
           char *template_name = entry->template_desc->name;
                                 ^
   security/integrity/ima/ima_api.c:325:6: note: Assuming the condition is false
           if (iint->measured_pcrs & (0x1 << pcr) && !modsig)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/integrity/ima/ima_api.c:325:41: note: Left side of '&&' is false
           if (iint->measured_pcrs & (0x1 << pcr) && !modsig)
                                                  ^
   security/integrity/ima/ima_api.c:328:11: note: Calling 'ima_alloc_init_template'
           result = ima_alloc_init_template(&event_data, &entry, template_desc);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/integrity/ima/ima_api.c:45:6: note: Assuming 'desc' is non-null
           if (desc)
               ^~~~
   security/integrity/ima/ima_api.c:45:2: note: Taking true branch
           if (desc)
           ^
   security/integrity/ima/ima_api.c:52:6: note: Assuming the condition is false
           if (!*entry)
               ^~~~~~~
   security/integrity/ima/ima_api.c:52:2: note: Taking false branch
           if (!*entry)
           ^
   security/integrity/ima/ima_api.c:55:29: note: Assuming 'ima_tpm_chip' is equal to null
           digests = kcalloc(NR_BANKS(ima_tpm_chip) + ima_extra_slots,
                                      ^
   security/integrity/ima/ima.h:44:26: note: expanded from macro 'NR_BANKS'
   #define NR_BANKS(chip) ((chip != NULL) ? chip->nr_allocated_banks : 0)
                            ^~~~~~~~~~~~
   security/integrity/ima/ima_api.c:55:20: note: '?' condition is false
           digests = kcalloc(NR_BANKS(ima_tpm_chip) + ima_extra_slots,
                             ^
   security/integrity/ima/ima.h:44:25: note: expanded from macro 'NR_BANKS'
   #define NR_BANKS(chip) ((chip != NULL) ? chip->nr_allocated_banks : 0)
                           ^
   security/integrity/ima/ima_api.c:57:6: note: Assuming 'digests' is non-null
           if (!digests) {
               ^~~~~~~~
   security/integrity/ima/ima_api.c:57:2: note: Taking false branch
           if (!digests) {
           ^
   security/integrity/ima/ima_api.c:65:14: note: Assuming 'i' is < field 'num_fields'
           for (i = 0; i < template_desc->num_fields; i++) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/integrity/ima/ima_api.c:65:2: note: Loop condition is true.  Entering loop body
           for (i = 0; i < template_desc->num_fields; i++) {
           ^
   security/integrity/ima/ima_api.c:72:7: note: Assuming 'result' is not equal to 0
                   if (result != 0)
                       ^~~~~~~~~~~
   security/integrity/ima/ima_api.c:72:3: note: Taking true branch
                   if (result != 0)
                   ^
   security/integrity/ima/ima_api.c:73:4: note: Control jumps to line 81
                           goto out;
                           ^
   security/integrity/ima/ima_api.c:82:2: note: Null pointer value stored to 'entry'
           *entry = NULL;
           ^~~~~~~~~~~~~
   security/integrity/ima/ima_api.c:328:11: note: Returning from 'ima_alloc_init_template'
           result = ima_alloc_init_template(&event_data, &entry, template_desc);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/integrity/ima/ima_api.c:329:6: note: Assuming 'result' is >= 0
           if (result < 0) {
               ^~~~~~~~~~
   security/integrity/ima/ima_api.c:329:2: note: Taking false branch
           if (result < 0) {
           ^
   security/integrity/ima/ima_api.c:335:30: note: Passing null pointer value via 1st parameter 'entry'
           result = ima_store_template(entry, violation, inode, filename, pcr);
                                       ^~~~~
   security/integrity/ima/ima_api.c:335:11: note: Calling 'ima_store_template'
           result = ima_store_template(entry, violation, inode, filename, pcr);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/integrity/ima/ima_api.c:108:24: note: Access to field 'template_desc' results in a dereference of a null pointer (loaded from variable 'entry')
           char *template_name = entry->template_desc->name;
                                 ^~~~~
   Suppressed 8 warnings (8 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.
   22 warnings generated.
   fs/verity/open.c:78:31: warning: The result of the left shift is undefined due to shifting by '4294967277', which is greater or equal to the width of type 'int' [clang-analyzer-core.UndefinedBinaryOperatorResult]
           params->hashes_per_block = 1 << params->log_arity;
                                        ^
   fs/verity/open.c:347:6: note: Assuming the condition is false
           if (!IS_VERITY(inode))
--
               ^~~~~~~
   security/keys/trusted-keys/trusted_tpm1.c:483:2: note: Taking false branch
           if (ret < 0)
           ^
   security/keys/trusted-keys/trusted_tpm1.c:490:8: note: Calling 'TSS_sha1'
           ret = TSS_sha1(td->xorwork, SHA1_DIGEST_SIZE * 2, td->xorhash);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/trusted-keys/trusted_tpm1.c:57:10: note: Calling 'init_sdesc'
           sdesc = init_sdesc(hashalg);
                   ^~~~~~~~~~~~~~~~~~~
   security/keys/trusted-keys/trusted_tpm1.c:44:10: note: Memory is allocated
           sdesc = kmalloc(size, GFP_KERNEL);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/trusted-keys/trusted_tpm1.c:45:6: note: Assuming 'sdesc' is non-null
           if (!sdesc)
               ^~~~~~
   security/keys/trusted-keys/trusted_tpm1.c:45:2: note: Taking false branch
           if (!sdesc)
           ^
   security/keys/trusted-keys/trusted_tpm1.c:57:10: note: Returned allocated memory
           sdesc = init_sdesc(hashalg);
                   ^~~~~~~~~~~~~~~~~~~
   security/keys/trusted-keys/trusted_tpm1.c:58:2: note: Taking true branch
           if (IS_ERR(sdesc)) {
           ^
   security/keys/trusted-keys/trusted_tpm1.c:59:3: note: Loop condition is false.  Exiting loop
                   pr_info("can't alloc %s\n", hash_alg);
                   ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   security/keys/trusted-keys/trusted_tpm1.c:490:8: note: Returned allocated memory
           ret = TSS_sha1(td->xorwork, SHA1_DIGEST_SIZE * 2, td->xorhash);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   security/keys/trusted-keys/trusted_tpm1.c:491:6: note: 'ret' is >= 0
           if (ret < 0)
               ^~~
   security/keys/trusted-keys/trusted_tpm1.c:491:2: note: Taking false branch
           if (ret < 0)
           ^
   security/keys/trusted-keys/trusted_tpm1.c:495:6: note: Assuming 'ret' is >= 0
           if (ret < 0)
               ^~~~~~~
   security/keys/trusted-keys/trusted_tpm1.c:495:2: note: Taking false branch
           if (ret < 0)
           ^
   security/keys/trusted-keys/trusted_tpm1.c:498:6: note: Potential leak of memory pointed to by 'ret'
           if (ret != TPM_NONCE_SIZE) {
               ^
   Suppressed 9 warnings (9 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/clk/socfpga/clk-periph.c:69:41: warning: The right operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
           periph_clk->hw.reg = clk_mgr_base_addr + reg;
                                                  ^
   drivers/clk/socfpga/clk-periph.c:108:2: note: Calling '__socfpga_periph_init'
           __socfpga_periph_init(node, &periclk_ops);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/socfpga/clk-periph.c:53:2: note: 'reg' declared without an initial value
           u32 reg;
           ^~~~~~~
   drivers/clk/socfpga/clk-periph.c:63:2: note: Calling 'of_property_read_u32'
           of_property_read_u32(node, "reg", &reg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/of.h:1256:9: note: Calling 'of_property_read_u32_array'
           return of_property_read_u32_array(np, propname, out_value, 1);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/of.h:752:2: note: Returning without writing to '*out_values'
           return -ENOSYS;
           ^
   include/linux/of.h:1256:9: note: Returning from 'of_property_read_u32_array'
           return of_property_read_u32_array(np, propname, out_value, 1);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/of.h:1256:2: note: Returning without writing to '*out_value'
           return of_property_read_u32_array(np, propname, out_value, 1);
           ^
   drivers/clk/socfpga/clk-periph.c:63:2: note: Returning from 'of_property_read_u32'
           of_property_read_u32(node, "reg", &reg);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/socfpga/clk-periph.c:66:14: note: Assuming 'periph_clk' is non-null
           if (WARN_ON(!periph_clk))
                       ^
   include/asm-generic/bug.h:166:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   drivers/clk/socfpga/clk-periph.c:66:2: note: Taking false branch
           if (WARN_ON(!periph_clk))
           ^
   drivers/clk/socfpga/clk-periph.c:69:41: note: The right operand of '+' is a garbage value
           periph_clk->hw.reg = clk_mgr_base_addr + reg;
                                                  ^ ~~~
>> drivers/clk/socfpga/clk-periph.c:103:2: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores]
           rc = of_clk_add_provider(node, of_clk_src_simple_get, hw_clk);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/clk/socfpga/clk-periph.c:103:2: note: Value stored to 'rc' is never read
           rc = of_clk_add_provider(node, of_clk_src_simple_get, hw_clk);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   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.
   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.
   fs/autofs/dev-ioctl.c:519:34: warning: Although the value stored to 'devid' is used in the enclosing expression, the value is never actually read from 'devid' [clang-analyzer-deadcode.DeadStores]
           param->ismountpoint.out.devid = devid = 0;
                                           ^       ~
   fs/autofs/dev-ioctl.c:519:34: note: Although the value stored to 'devid' is used in the enclosing expression, the value is never actually read from 'devid'
           param->ismountpoint.out.devid = devid = 0;
                                           ^       ~
   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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   10 warnings generated.
   fs/debugfs/file.c:63:9: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
           return fsd->real_fops;
                  ^
   fs/debugfs/file.c:252:6: note: Calling 'debugfs_file_get'
           if (debugfs_file_get(dentry))
               ^~~~~~~~~~~~~~~~~~~~~~~~
   fs/debugfs/file.c:87:10: note: Left side of '||' is false
           d_fsd = READ_ONCE(dentry->d_fsdata);
                   ^
   include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
                              ^
   include/linux/compiler_types.h:290:3: note: expanded from macro '__native_word'
           (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
            ^
   fs/debugfs/file.c:87:10: note: Left side of '||' is false
           d_fsd = READ_ONCE(dentry->d_fsdata);
                   ^
   include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
                              ^
   include/linux/compiler_types.h:290:3: note: expanded from macro '__native_word'
           (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
            ^
   fs/debugfs/file.c:87:10: note: Left side of '||' is true
           d_fsd = READ_ONCE(dentry->d_fsdata);
                   ^
   include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
                              ^
   include/linux/compiler_types.h:291:28: note: expanded from macro '__native_word'
            sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
                                     ^
   fs/debugfs/file.c:87:10: note: Taking false branch
           d_fsd = READ_ONCE(dentry->d_fsdata);
                   ^
   include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
           ^
   include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:302:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   fs/debugfs/file.c:87:10: note: Loop condition is false.  Exiting loop
           d_fsd = READ_ONCE(dentry->d_fsdata);
                   ^
   include/asm-generic/rwonce.h:49:2: note: expanded from macro 'READ_ONCE'
           compiletime_assert_rwonce_type(x);                              \
           ^
   include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type'
           compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
           ^
   include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
--
                           ^
   include/asm-generic/bug.h:166:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   drivers/gpu/drm/vkms/vkms_crtc.c:199:8: note: Access to field 'visible' results in a dereference of a null pointer (loaded from variable 'plane_state')
                   if (!plane_state->visible)
                        ^~~~~~~~~~~
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   10 warnings generated.
   drivers/clk/clk-max9485.c:199:9: warning: Access to field 'out' results in a dereference of a null pointer (loaded from variable 'prev') [clang-analyzer-core.NullDereference]
           return prev->out;
                  ^~~~
   drivers/clk/clk-max9485.c:165:36: note: 'prev' initialized to a null pointer value
           const struct max9485_rate *curr, *prev = NULL;
                                             ^~~~
   drivers/clk/clk-max9485.c:167:29: note: Assuming field 'out' is equal to 0
           for (curr = max9485_rates; curr->out != 0; curr++) {
                                      ^~~~~~~~~~~~~~
   drivers/clk/clk-max9485.c:167:2: note: Loop condition is false. Execution continues on line 199
           for (curr = max9485_rates; curr->out != 0; curr++) {
           ^
   drivers/clk/clk-max9485.c:199:9: note: Access to field 'out' results in a dereference of a null pointer (loaded from variable 'prev')
           return prev->out;
                  ^~~~
   Suppressed 9 warnings (9 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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   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.
   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.
   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.
   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.
   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.
   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.
   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/clk/socfpga/clk-gate.c:37:10: warning: Although the value stored to 'l4_src' is used in the enclosing expression, the value is never actually read from 'l4_src' [clang-analyzer-deadcode.DeadStores]
                   return l4_src &= 0x1;
                          ^         ~~~
   drivers/clk/socfpga/clk-gate.c:37:10: note: Although the value stored to 'l4_src' is used in the enclosing expression, the value is never actually read from 'l4_src'
                   return l4_src &= 0x1;
                          ^         ~~~
>> drivers/clk/socfpga/clk-gate.c:46:10: warning: Although the value stored to 'perpll_src' is used in the enclosing expression, the value is never actually read from 'perpll_src' [clang-analyzer-deadcode.DeadStores]
                   return perpll_src &= 0x3;
                          ^             ~~~
   drivers/clk/socfpga/clk-gate.c:46:10: note: Although the value stored to 'perpll_src' is used in the enclosing expression, the value is never actually read from 'perpll_src'
                   return perpll_src &= 0x3;
                          ^             ~~~
   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.
   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.
   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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   16 warnings generated.
   drivers/misc/lis3lv02d/lis3lv02d.c:160:3: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
                   return -hw_values[-axis - 1];
                   ^
   drivers/misc/lis3lv02d/lis3lv02d.c:1132:2: note: Control jumps to 'case WAI_3DC:'  at line 1155
           switch (lis3->whoami) {
           ^
   drivers/misc/lis3lv02d/lis3lv02d.c:1156:3: note: Loop condition is false.  Exiting loop
                   pr_info("8 bits 3DC sensor found\n");
                   ^
   include/linux/printk.h:519:2: note: expanded from macro 'pr_info'
           printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro '__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   drivers/misc/lis3lv02d/lis3lv02d.c:1163:3: note:  Execution continues on line 1179
                   break;
                   ^
   drivers/misc/lis3lv02d/lis3lv02d.c:1179:28: note: '?' condition is true
           lis3->reg_cache = kzalloc(max(sizeof(lis3_wai8_regs),
                                     ^
   include/linux/minmax.h:52:19: note: expanded from macro 'max'
   #define max(x, y)       __careful_cmp(x, y, >)
                           ^
   include/linux/minmax.h:37:3: note: expanded from macro '__careful_cmp'
                   __cmp(x, y, op), \
                   ^
   include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
   #define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
                            ^
   drivers/misc/lis3lv02d/lis3lv02d.c:1182:6: note: Assuming field 'reg_cache' is not equal to NULL
           if (lis3->reg_cache == NULL)
               ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/lis3lv02d/lis3lv02d.c:1182:2: note: Taking false branch
           if (lis3->reg_cache == NULL)
           ^
   drivers/misc/lis3lv02d/lis3lv02d.c:1185:2: note: Loop condition is false.  Exiting loop
           mutex_init(&lis3->mutex);
           ^
   include/linux/mutex.h:101:32: note: expanded from macro 'mutex_init'
   #define mutex_init(mutex)                                               \
                                                                           ^
   drivers/misc/lis3lv02d/lis3lv02d.c:1190:6: note: 'err' is 0
           if (err) {
               ^~~
   drivers/misc/lis3lv02d/lis3lv02d.c:1190:2: note: Taking false branch
           if (err) {
           ^
   drivers/misc/lis3lv02d/lis3lv02d.c:1195:6: note: Assuming field 'pm_dev' is null
           if (lis3->pm_dev) {
               ^~~~~~~~~~~~
   drivers/misc/lis3lv02d/lis3lv02d.c:1195:2: note: Taking false branch
           if (lis3->pm_dev) {
           ^
   drivers/misc/lis3lv02d/lis3lv02d.c:1200:6: note: Calling 'lis3lv02d_joystick_enable'
           if (lis3lv02d_joystick_enable(lis3))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/lis3lv02d/lis3lv02d.c:687:6: note: Assuming field 'idev' is null
           if (lis3->idev)
               ^~~~~~~~~~
   drivers/misc/lis3lv02d/lis3lv02d.c:687:2: note: Taking false branch
           if (lis3->idev)
           ^
   drivers/misc/lis3lv02d/lis3lv02d.c:691:6: note: Assuming 'input_dev' is non-null
           if (!input_dev)
               ^~~~~~~~~~
   drivers/misc/lis3lv02d/lis3lv02d.c:691:2: note: Taking false branch
           if (!input_dev)

vim +154 arch/arm/mach-ep93xx/clock.c

ff05c0330b9880 Hartley Sweeten 2009-05-07  125  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  126  static struct clk_hw *ep93xx_clk_register_gate(const char *name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  127  				    const char *parent_name,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  128  				    void __iomem *reg,
9645ccc7bd7a16 Nikita Shubin   2021-10-18  129  				    u8 bit_idx)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  130  {
9645ccc7bd7a16 Nikita Shubin   2021-10-18  131  	struct clk_init_data init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  132  	struct clk_psc *psc;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  133  	struct clk *clk;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  134  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  135  	psc = kzalloc(sizeof(*psc), GFP_KERNEL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  136  	if (!psc)
9645ccc7bd7a16 Nikita Shubin   2021-10-18  137  		return ERR_PTR(-ENOMEM);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  138  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  139  	init.name = name;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  140  	init.ops = &clk_ep93xx_gate_ops;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  141  	init.flags = CLK_SET_RATE_PARENT;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  142  	init.parent_names = (parent_name ? &parent_name : NULL);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  143  	init.num_parents = (parent_name ? 1 : 0);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  144  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  145  	psc->reg = reg;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  146  	psc->bit_idx = bit_idx;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  147  	psc->hw.init = &init;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  148  	psc->lock = &clk_lock;
9645ccc7bd7a16 Nikita Shubin   2021-10-18  149  
9645ccc7bd7a16 Nikita Shubin   2021-10-18  150  	clk = clk_register(NULL, &psc->hw);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  151  	if (IS_ERR(clk))
9645ccc7bd7a16 Nikita Shubin   2021-10-18  152  		kfree(psc);
9645ccc7bd7a16 Nikita Shubin   2021-10-18  153  
9645ccc7bd7a16 Nikita Shubin   2021-10-18 @154  	return &psc->hw;
ff05c0330b9880 Hartley Sweeten 2009-05-07  155  }
ff05c0330b9880 Hartley Sweeten 2009-05-07  156  

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-01-25 21:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 20:13 arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc] kernel test robot
2022-01-20  1:46 ` kernel test robot
2022-01-20  1:46   ` kernel test robot
2022-01-24 21:50   ` Nick Desaulniers
2022-01-24 21:50     ` Nick Desaulniers
2022-01-25  8:01     ` Nikita Shubin
2022-01-25  8:01       ` Nikita Shubin
2022-01-25 21:08       ` Nick Desaulniers
2022-01-25 21:08         ` Nick Desaulniers
  -- strict thread matches above, loose matches on Subject: below --
2022-01-02  1:50 kernel test robot
2021-12-16  6:54 kernel test robot
2021-11-28  0:02 kernel test robot
2021-11-24 22:42 kernel test robot

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.