lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sun, 9 Aug 2020 20:10:56 +0800
From:   kernel test robot <lkp@...el.com>
To:     Chao Yu <yuchao0@...wei.com>, Chao Yu <chao@...nel.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Jaegeuk Kim <jaegeuk@...nel.org>
Subject: fs/f2fs/file.c:761:9: warning: Identical condition 'err', second
 condition is always false

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   06a81c1c7db9bd5de0bd38cd5acc44bb22b99150
commit: 3265d3db1f16395cfc6b8ea9b31b4001d98d05ef f2fs: support partial truncation on compressed inode
date:   3 months ago
compiler: xtensa-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>


cppcheck warnings: (new ones prefixed by >>)

>> fs/f2fs/file.c:761:9: warning: Identical condition 'err', second condition is always false [identicalConditionAfterEarlyExit]
    return err;
           ^
   fs/f2fs/file.c:753:6: note: first condition
    if (err)
        ^
   fs/f2fs/file.c:761:9: note: second condition
    return err;
           ^
>> fs/f2fs/file.c:1689:12: warning: Variable 'new_size' is reassigned a value before the old one has been used. [redundantAssignment]
     new_size = (last_off == pg_end) ? offset + len :
              ^
   fs/f2fs/file.c:1620:0: note: Variable 'new_size' is reassigned a value before the old one has been used.
    loff_t new_size = i_size_read(inode);
   ^
   fs/f2fs/file.c:1689:12: note: Variable 'new_size' is reassigned a value before the old one has been used.
     new_size = (last_off == pg_end) ? offset + len :
              ^
>> fs/f2fs/file.c:2789:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
    ret = -EINVAL;
        ^
   fs/f2fs/file.c:2784:7: note: Variable 'ret' is reassigned a value before the old one has been used.
     ret = -EBUSY;
         ^
   fs/f2fs/file.c:2789:6: note: Variable 'ret' is reassigned a value before the old one has been used.
    ret = -EINVAL;
        ^
   fs/f2fs/file.c:2811:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
    ret = f2fs_convert_inline_inode(src);
        ^
   fs/f2fs/file.c:2789:6: note: Variable 'ret' is reassigned a value before the old one has been used.
    ret = -EINVAL;
        ^
   fs/f2fs/file.c:2811:6: note: Variable 'ret' is reassigned a value before the old one has been used.
    ret = f2fs_convert_inline_inode(src);
        ^
   fs/f2fs/file.c:2840:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
    ret = __exchange_data_block(src, dst, pos_in >> F2FS_BLKSIZE_BITS,
        ^
   fs/f2fs/file.c:2834:7: note: Variable 'ret' is reassigned a value before the old one has been used.
     ret = -EBUSY;
         ^
   fs/f2fs/file.c:2840:6: note: Variable 'ret' is reassigned a value before the old one has been used.
    ret = __exchange_data_block(src, dst, pos_in >> F2FS_BLKSIZE_BITS,
        ^
   fs/f2fs/f2fs.h:2209:15: warning: Local variable valid_node_count shadows outer function [shadowFunction]
    unsigned int valid_node_count, user_block_count;
                 ^
   fs/f2fs/f2fs.h:2305:28: note: Shadowed declaration
   static inline unsigned int valid_node_count(struct f2fs_sb_info *sbi)
                              ^
   fs/f2fs/f2fs.h:2209:15: note: Shadow variable
    unsigned int valid_node_count, user_block_count;
                 ^

vim +/err +761 fs/f2fs/file.c

   760	
 > 761		return err;
   762	}
   763	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ