CC: [email protected] CC: [email protected] CC: Linux Memory Management List <[email protected]> TO: Linus Walleij <[email protected]> CC: Pavel Machek <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 42d0b5f52c9b633a10626da27786049c76d4ea75 commit: 61fa67a4e538f70bb4e6b3e7f3555402c1713654 [901/3590] leds: lm3601x: Move driver to flash subdirectory :::::: branch date: 5 hours ago :::::: commit date: 2 weeks ago config: x86_64-randconfig-c001-20210726 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c63dbd850182797bc4b76124d08e1c320ab2365d) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=61fa67a4e538f70bb4e6b3e7f3555402c1713654 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 61fa67a4e538f70bb4e6b3e7f3555402c1713654 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> clang-analyzer warnings: (new ones prefixed by >>) ^ mm/memory.c:2571:26: note: Assuming '__ret_warn_on' is 0 if (!pmd_none(*pmd) && WARN_ON_ONCE(pmd_bad(*pmd))) { ^ include/asm-generic/bug.h:105:6: note: expanded from macro 'WARN_ON_ONCE' if (unlikely(__ret_warn_on)) \ ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:78:40: note: expanded from macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^~~~ mm/memory.c:2571:26: note: Taking false branch if (!pmd_none(*pmd) && WARN_ON_ONCE(pmd_bad(*pmd))) { ^ include/asm-generic/bug.h:105:2: note: expanded from macro 'WARN_ON_ONCE' if (unlikely(__ret_warn_on)) \ ^ mm/memory.c:2571:3: note: Taking false branch if (!pmd_none(*pmd) && WARN_ON_ONCE(pmd_bad(*pmd))) { ^ mm/memory.c:2576:9: note: Calling 'apply_to_pte_range' err = apply_to_pte_range(mm, pmd, addr, next, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mm/memory.c:2511:2: note: 'ptl' declared without an initial value spinlock_t *ptl; ^~~~~~~~~~~~~~~ mm/memory.c:2513:6: note: 'create' is false if (create) { ^~~~~~ mm/memory.c:2513:2: note: Taking false branch if (create) { ^ mm/memory.c:2520:23: note: Assuming the condition is true mapped_pte = pte = (mm == &init_mm) ? ^~~~~~~~~~~~~~ mm/memory.c:2520:22: note: '?' condition is true mapped_pte = pte = (mm == &init_mm) ? ^ mm/memory.c:2525:2: note: Taking false branch BUG_ON(pmd_huge(*pmd)); ^ include/asm-generic/bug.h:65:32: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^ mm/memory.c:2525:2: note: Loop condition is false. Exiting loop BUG_ON(pmd_huge(*pmd)); ^ include/asm-generic/bug.h:65:27: note: expanded from macro 'BUG_ON' #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) ^ mm/memory.c:2527:2: note: Loop condition is false. Exiting loop arch_enter_lazy_mmu_mode(); ^ include/linux/pgtable.h:977:36: note: expanded from macro 'arch_enter_lazy_mmu_mode' #define arch_enter_lazy_mmu_mode() do {} while (0) ^ mm/memory.c:2529:6: note: Assuming 'fn' is null if (fn) { ^~ mm/memory.c:2529:2: note: Taking false branch if (fn) { ^ mm/memory.c:2540:2: note: Loop condition is false. Exiting loop arch_leave_lazy_mmu_mode(); ^ include/linux/pgtable.h:978:36: note: expanded from macro 'arch_leave_lazy_mmu_mode' #define arch_leave_lazy_mmu_mode() do {} while (0) ^ mm/memory.c:2542:6: note: Assuming the condition is true if (mm != &init_mm) ^~~~~~~~~~~~~~ mm/memory.c:2542:2: note: Taking true branch if (mm != &init_mm) ^ mm/memory.c:2543:3: note: 1st function call argument is an uninitialized value pte_unmap_unlock(mapped_pte, ptl); ^ include/linux/mm.h:2273:2: note: expanded from macro 'pte_unmap_unlock' spin_unlock(ptl); \ ^ ~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (3 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. 5 warnings generated. drivers/mtd/mtdcore.c:660:3: warning: Value stored to 'error' is never read [clang-analyzer-deadcode.DeadStores] error = 0; ^ ~ drivers/mtd/mtdcore.c:660:3: note: Value stored to 'error' is never read error = 0; ^ ~ 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. >> drivers/leds/flash/leds-lm3601x.c:226:3: warning: Value stored to 'ret' is >> never read [clang-analyzer-deadcode.DeadStores] ret = regmap_update_bits(led->regmap, LM3601X_CFG_REG, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/leds/flash/leds-lm3601x.c:226:3: note: Value stored to 'ret' is never read ret = regmap_update_bits(led->regmap, LM3601X_CFG_REG, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/leds/flash/leds-lm3601x.c:230:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = regmap_update_bits(led->regmap, LM3601X_ENABLE_REG, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/leds/flash/leds-lm3601x.c:230:3: note: Value stored to 'ret' is never read ret = regmap_update_bits(led->regmap, LM3601X_ENABLE_REG, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/leds/flash/leds-lm3601x.c:234:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = regmap_update_bits(led->regmap, LM3601X_ENABLE_REG, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/leds/flash/leds-lm3601x.c:234:3: note: Value stored to 'ret' is never read ret = regmap_update_bits(led->regmap, LM3601X_ENABLE_REG, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. Suppressed 4 warnings (4 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 3 warnings generated. Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. drivers/firmware/dmi-id.c:102: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(buffer, "dmi"); ^~~~~~ drivers/firmware/dmi-id.c:102: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(buffer, "dmi"); ^~~~~~ Suppressed 3 warnings (3 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 4 warnings generated. drivers/firmware/qemu_fw_cfg.c:559:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn] return ret; ^ drivers/firmware/qemu_fw_cfg.c:687:6: note: Assuming 'fw_cfg_sel_ko' is null if (fw_cfg_sel_ko) ^~~~~~~~~~~~~ drivers/firmware/qemu_fw_cfg.c:687:2: note: Taking false branch if (fw_cfg_sel_ko) ^ drivers/firmware/qemu_fw_cfg.c:693:6: note: Assuming 'fw_cfg_sel_ko' is non-null if (!fw_cfg_sel_ko) ^~~~~~~~~~~~~~ drivers/firmware/qemu_fw_cfg.c:693:2: note: Taking false branch if (!fw_cfg_sel_ko) ^ drivers/firmware/qemu_fw_cfg.c:696:6: note: Assuming 'fw_cfg_fname_kset' is non-null if (!fw_cfg_fname_kset) ^~~~~~~~~~~~~~~~~~ drivers/firmware/qemu_fw_cfg.c:696:2: note: Taking false branch if (!fw_cfg_fname_kset) ^ drivers/firmware/qemu_fw_cfg.c:701:6: note: 'err' is 0 if (err) ^~~ drivers/firmware/qemu_fw_cfg.c:701:2: note: Taking false branch if (err) ^ drivers/firmware/qemu_fw_cfg.c:706:6: note: 'err' is >= 0 if (err < 0) ^~~ drivers/firmware/qemu_fw_cfg.c:706:2: note: Taking false branch if (err < 0) ^ drivers/firmware/qemu_fw_cfg.c:711:6: note: Assuming 'err' is 0 if (err) ^~~ drivers/firmware/qemu_fw_cfg.c:711:2: note: Taking false branch if (err) ^ drivers/firmware/qemu_fw_cfg.c:715:8: note: Calling 'fw_cfg_register_dir_entries' err = fw_cfg_register_dir_entries(); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/firmware/qemu_fw_cfg.c:643:6: note: 'ret' is >= 0 if (ret < 0) ^~~ drivers/firmware/qemu_fw_cfg.c:643:2: note: Taking false branch if (ret < 0) ^ drivers/firmware/qemu_fw_cfg.c:650:6: note: Assuming 'dir' is non-null if (!dir) ^~~~ drivers/firmware/qemu_fw_cfg.c:650:2: note: Taking false branch if (!dir) ^ drivers/firmware/qemu_fw_cfg.c:655:6: note: Assuming 'ret' is >= 0 if (ret < 0) vim +/ret +226 drivers/leds/flash/leds-lm3601x.c 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 205 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 206 static int lm3601x_strobe_set(struct led_classdev_flash *fled_cdev, 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 207 bool state) 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 208 { 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 209 struct lm3601x_led *led = fled_cdev_to_led(fled_cdev); 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 210 int timeout_reg_val; 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 211 int current_timeout; 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 212 int ret; 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 213 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 214 mutex_lock(&led->lock); 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 215 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 216 ret = regmap_read(led->regmap, LM3601X_CFG_REG, ¤t_timeout); 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 217 if (ret < 0) 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 218 goto out; 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 219 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 220 if (led->flash_timeout >= LM3601X_TIMEOUT_XOVER_US) 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 221 timeout_reg_val = led->flash_timeout / LM3601X_UPPER_STEP_US + 0x07; 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 222 else 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 223 timeout_reg_val = led->flash_timeout / LM3601X_LOWER_STEP_US - 0x01; 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 224 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 225 if (led->flash_timeout != current_timeout) 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 @226 ret = regmap_update_bits(led->regmap, LM3601X_CFG_REG, 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 227 LM3601X_TIMEOUT_MASK, timeout_reg_val); 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 228 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 229 if (state) 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 230 ret = regmap_update_bits(led->regmap, LM3601X_ENABLE_REG, 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 231 LM3601X_MODE_TORCH | LM3601X_MODE_IR_DRV, 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 232 LM3601X_MODE_STROBE); 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 233 else 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 234 ret = regmap_update_bits(led->regmap, LM3601X_ENABLE_REG, 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 235 LM3601X_MODE_STROBE, LED_OFF); 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 236 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 237 ret = lm3601x_read_faults(led); 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 238 out: 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 239 mutex_unlock(&led->lock); 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 240 return ret; 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 241 } 57a53297cc861d drivers/leds/leds-lm3601x.c Dan Murphy 2018-05-23 242 :::::: The code at line 226 was first introduced by commit :::::: 57a53297cc861de7d16f1a1b49e8f7ff9b22915b leds: lm3601x: Introduce the lm3601x LED driver :::::: TO: Dan Murphy <[email protected]> :::::: CC: Jacek Anaszewski <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected]
.config.gz
Description: application/gzip
_______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
