tree:
https://android.googlesource.com/kernel/common upstream-f2fs-stable-linux-4.14.y
head: a3a7060dbf1cbd67200c603af058706a8affb127
commit: bee5bd5b8f2ec1010f53d66aa26ac9b23dcdf271 [903/1043] fscrypt: optimize
fscrypt_zeroout_range()
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
> fs/ubifs/super.c:1238:6: warning: Variable 'err' is
reassigned a value before the old one has been used. [redundantAssignment]
err =
ubifs_read_superblock(c);
^
fs/ubifs/super.c:1210:6: note: Variable 'err' is reassigned a value before the
old one has been used.
err = -ENOMEM;
^
fs/ubifs/super.c:1238:6: note: Variable 'err' is reassigned a value before the
old one has been used.
err = ubifs_read_superblock(c);
^
> fs/ubifs/super.c:2162:54: warning: Clarify calculation precedence
for '&' and '?'. [clarifyCalculation]
err =
ubifs_fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
^
--
> fs/ubifs/sb.c:843:9: warning: Identical condition 'err',
second condition is always false [identicalConditionAfterEarlyExit]
return err;
^
fs/ubifs/sb.c:839:6: note: first condition
if (err)
^
fs/ubifs/sb.c:843:9: note: second condition
return err;
^
> fs/unicode/utf8-selftest.c:190:3: warning: Conversion of string
literal "" to bool always evaluates to true. [incorrectStringBooleanError]
test((utf8len(data, nfdi_test_data[i].str) == nlen));
^
fs/unicode/utf8-selftest.c:191:3: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test((utf8nlen(data, nfdi_test_data[i].str, len) == nlen));
^
fs/unicode/utf8-selftest.c:197:4: warning: Conversion of string literal
"Unexpected byte 0x%x should be 0x%xn" to bool always evaluates to true.
[incorrectStringBooleanError]
test_f((c == nfdi_test_data[i].dec[j]),
^
fs/unicode/utf8-selftest.c:203:3: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test((j == nlen));
^
fs/unicode/utf8-selftest.c:226:3: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test((utf8len(data, nfdicf_test_data[i].str) == nlen));
^
fs/unicode/utf8-selftest.c:227:3: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test((utf8nlen(data, nfdicf_test_data[i].str, len) == nlen));
^
fs/unicode/utf8-selftest.c:233:4: warning: Conversion of string literal
"Unexpected byte 0x%x should be 0x%xn" to bool always evaluates to true.
[incorrectStringBooleanError]
test_f((c == nfdicf_test_data[i].ncf[j]),
^
fs/unicode/utf8-selftest.c:239:3: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test((j == nlen));
^
fs/unicode/utf8-selftest.c:260:3: warning: Conversion of string literal "%s %s
comparison mismatchn" to bool always evaluates to true.
[incorrectStringBooleanError]
test_f(!utf8_strncmp(table, &s1, &s2),
^
fs/unicode/utf8-selftest.c:270:3: warning: Conversion of string literal "%s %s
comparison mismatchn" to bool always evaluates to true.
[incorrectStringBooleanError]
test_f(!utf8_strncasecmp(table, &s1, &s2),
^
fs/unicode/utf8-selftest.c:280:2: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test(utf8version_is_supported(7, 0, 0));
^
fs/unicode/utf8-selftest.c:283:2: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test(utf8version_is_supported(9, 0, 0));
^
fs/unicode/utf8-selftest.c:286:2: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test(utf8version_is_supported(latest_maj, latest_min, latest_rev));
^
fs/unicode/utf8-selftest.c:289:2: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test(!utf8version_is_supported(13, 0, 0));
^
fs/unicode/utf8-selftest.c:290:2: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test(!utf8version_is_supported(0, 0, 0));
^
fs/unicode/utf8-selftest.c:291:2: warning: Conversion of string literal "" to
bool always evaluates to true. [incorrectStringBooleanError]
test(!utf8version_is_supported(-1, -1, -1));
^
--
> fs/verity/enable.c:150:6: warning: Variable 'err' is
reassigned a value before the old one has been used. [redundantAssignment]
err =
0;
^
fs/verity/enable.c:121:0: note: Variable 'err' is reassigned a value before the
old one has been used.
int err = -ENOMEM;
^
fs/verity/enable.c:150:6: note: Variable 'err' is reassigned a value before the
old one has been used.
err = 0;
^
--
> fs/locks.c:587:8: warning: Variable 'error' is reassigned
a value before the old one has been used. [redundantAssignment]
error =
lease_init(filp, type, fl);
^
fs/locks.c:582:0: note: Variable 'error' is reassigned a value before the old
one has been used.
int error = -ENOMEM;
^
fs/locks.c:587:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = lease_init(filp, type, fl);
^
fs/locks.c:976:9: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = FILE_LOCK_DEFERRED;
^
fs/locks.c:973:9: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EAGAIN;
^
fs/locks.c:976:9: note: Variable 'error' is reassigned a value before the old
one has been used.
error = FILE_LOCK_DEFERRED;
^
fs/locks.c:1046:10: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = -EDEADLK;
^
fs/locks.c:1039:10: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EAGAIN;
^
fs/locks.c:1046:10: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EDEADLK;
^
fs/locks.c:1158:8: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = -ENOLCK; /* "no luck" */
^
fs/locks.c:1140:11: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -ENOLCK;
^
fs/locks.c:1158:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -ENOLCK; /* "no luck" */
^
fs/locks.c:1162:8: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = 0;
^
fs/locks.c:1158:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -ENOLCK; /* "no luck" */
^
fs/locks.c:1162:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = 0;
^
fs/locks.c:1752:8: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = -EINVAL;
^
fs/locks.c:1722:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EAGAIN;
^
fs/locks.c:1752:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EINVAL;
^
fs/locks.c:1767:8: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = check_conflicting_open(dentry, arg, lease->fl_flags);
^
fs/locks.c:1752:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EINVAL;
^
fs/locks.c:1767:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = check_conflicting_open(dentry, arg, lease->fl_flags);
^
fs/locks.c:2024:8: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = security_file_lock(f.file, lock->fl_type);
^
fs/locks.c:2003:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EBADF;
^
fs/locks.c:2024:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = security_file_lock(f.file, lock->fl_type);
^
fs/locks.c:2140:8: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = flock_to_posix_lock(filp, fl, flock);
^
fs/locks.c:2136:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EINVAL;
^
fs/locks.c:2140:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = flock_to_posix_lock(filp, fl, flock);
^
fs/locks.c:2154:8: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = vfs_test_lock(filp, fl);
^
fs/locks.c:2145:9: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EINVAL;
^
fs/locks.c:2154:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = vfs_test_lock(filp, fl);
^
> fs/locks.c:2308:8: warning: Variable 'error' is
reassigned a value before the old one has been used. 'break;' missing?
[redundantAssignInSwitch]
error = do_lock_file_wait(filp, cmd, file_lock);
^
fs/locks.c:2287:9: note: Variable 'error' is reassigned a value before the old
one has been used. 'break;' missing?
error = -EINVAL;
^
fs/locks.c:2308:8: note: Variable 'error' is reassigned a value before the old
one has been used. 'break;' missing?
error = do_lock_file_wait(filp, cmd, file_lock);
^
> fs/locks.c:2308:8: warning: Variable 'error' is
reassigned a value before the old one has been used. 'break;' missing?
[redundantAssignInSwitch]
error = do_lock_file_wait(filp, cmd, file_lock);
^
fs/locks.c:2296:9: note: Variable 'error' is reassigned a value before the old
one has been used. 'break;' missing?
error = -EINVAL;
^
fs/locks.c:2308:8: note: Variable 'error' is reassigned a value before the old
one has been used. 'break;' missing?
error = do_lock_file_wait(filp, cmd, file_lock);
^
fs/locks.c:2355:8: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = flock64_to_posix_lock(filp, fl, flock);
^
fs/locks.c:2351:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EINVAL;
^
fs/locks.c:2355:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = flock64_to_posix_lock(filp, fl, flock);
^
fs/locks.c:2369:8: warning: Variable 'error' is reassigned a value before the
old one has been used. [redundantAssignment]
error = vfs_test_lock(filp, fl);
^
fs/locks.c:2360:9: note: Variable 'error' is reassigned a value before the old
one has been used.
error = -EINVAL;
^
fs/locks.c:2369:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = vfs_test_lock(filp, fl);
^
fs/locks.c:2439:8: warning: Variable 'error' is reassigned a value before the
old one has been used. 'break;' missing? [redundantAssignInSwitch]
error = do_lock_file_wait(filp, cmd, file_lock);
^
fs/locks.c:2418:9: note: Variable 'error' is reassigned a value before the old
one has been used. 'break;' missing?
error = -EINVAL;
^
fs/locks.c:2439:8: note: Variable 'error' is reassigned a value before the old
one has been used. 'break;' missing?
error = do_lock_file_wait(filp, cmd, file_lock);
^
fs/locks.c:2439:8: warning: Variable 'error' is reassigned a value before the
old one has been used. 'break;' missing? [redundantAssignInSwitch]
error = do_lock_file_wait(filp, cmd, file_lock);
^
fs/locks.c:2427:9: note: Variable 'error' is reassigned a value before the old
one has been used. 'break;' missing?
error = -EINVAL;
^
fs/locks.c:2439:8: note: Variable 'error' is reassigned a value before the old
one has been used. 'break;' missing?
error = do_lock_file_wait(filp, cmd, file_lock);
^
--
> fs/posix_acl.c:670:56: warning: Either the condition
'!value' is redundant or there is pointer arithmetic with NULL pointer.
[nullPointerArithmeticRedundantCheck]
struct posix_acl_xattr_entry *entry =
(void *)(header + 1), *end;
^
fs/posix_acl.c:675:6: note: Assuming that condition '!value' is not redundant
if (!value)
^
fs/posix_acl.c:669:42: note: Assignment 'header=value', assigned value is 0
struct posix_acl_xattr_header *header = value;
^
fs/posix_acl.c:670:56: note: Null pointer addition
struct posix_acl_xattr_entry *entry = (void *)(header + 1), *end;
^
fs/posix_acl.c:728:68: warning: Either the condition '!value' is redundant or
there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
const struct posix_acl_xattr_entry *entry = (const void *)(header + 1), *end;
^
fs/posix_acl.c:733:6: note: Assuming that condition '!value' is not redundant
if (!value)
^
fs/posix_acl.c:727:48: note: Assignment 'header=value', assigned value is 0
const struct posix_acl_xattr_header *header = value;
^
fs/posix_acl.c:728:68: note: Null pointer addition
const struct posix_acl_xattr_entry *entry = (const void *)(header + 1), *end;
^
> fs/posix_acl.c:607:6: warning: Variable 'ret' is
reassigned a value before the old one has been used. [redundantAssignment]
ret =
posix_acl_create_masq(clone, mode);
^
fs/posix_acl.c:602:6: note: Variable 'ret' is reassigned a value before the old
one has been used.
ret = -ENOMEM;
^
fs/posix_acl.c:607:6: note: Variable 'ret' is reassigned a value before the old
one has been used.
ret = posix_acl_create_masq(clone, mode);
^
> fs/ubifs/crypto.c:61:11: warning: Checking if unsigned variable
'clen' is less than zero. [unsignedLessThanZero]
if (clen <= 0 ||
clen > UBIFS_BLOCK_SIZE || clen > dlen) {
^
> security/keys/process_keys.c:674:11: warning: Variable
'key_ref' is reassigned a value before the old one has been used.
[redundantAssignment]
key_ref = make_key_ref(key, 1);
^
security/keys/process_keys.c:664:12: note: Variable 'key_ref' is reassigned a
value before the old one has been used.
key_ref = ERR_PTR(-EKEYREVOKED);
^
security/keys/process_keys.c:674:11: note: Variable 'key_ref' is reassigned a
value before the old one has been used.
key_ref = make_key_ref(key, 1);
^
security/keys/process_keys.c:688:11: warning: Variable 'key_ref' is reassigned
a value before the old one has been used. [redundantAssignment]
key_ref = make_key_ref(key, 0);
^
security/keys/process_keys.c:678:11: note: Variable 'key_ref' is reassigned a
value before the old one has been used.
key_ref = ERR_PTR(-EINVAL);
^
security/keys/process_keys.c:688:11: note: Variable 'key_ref' is reassigned a
value before the old one has been used.
key_ref = make_key_ref(key, 0);
^
> security/keys/process_keys.c:737:6: warning: Variable
'ret' is reassigned a value before the old one has been used.
[redundantAssignment]
ret = key_task_permission(key_ref, ctx.cred, perm);
^
security/keys/process_keys.c:731:6: note: Variable 'ret' is reassigned a value
before the old one has been used.
ret = -EIO;
^
security/keys/process_keys.c:737:6: note: Variable 'ret' is reassigned a value
before the old one has been used.
ret = key_task_permission(key_ref, ctx.cred, perm);
^
> fs/super.c:1235:8: warning: Variable 'error' is
reassigned a value before the old one has been used. [redundantAssignment]
error
= security_sb_kern_mount(sb, flags, secdata);
^
fs/super.c:1213:0: note: Variable 'error' is reassigned a value before the old
one has been used.
int error = -ENOMEM;
^
fs/super.c:1235:8: note: Variable 'error' is reassigned a value before the old
one has been used.
error = security_sb_kern_mount(sb, flags, secdata);
^
fs/super.c:1039:48: warning: Clarify calculation precedence for '&' and
'?'. [clarifyCalculation]
err = fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
^
fs/super.c:1168:48: warning: Clarify calculation precedence for '&' and
'?'. [clarifyCalculation]
error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
^
fs/super.c:1194:49: warning: Clarify calculation precedence for '&' and
'?'. [clarifyCalculation]
error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
^
fs/super.c:1122:49: warning: Clarify calculation precedence for '&' and
'?'. [clarifyCalculation]
error = fill_super(s, data, flags & SB_SILENT ? 1 : 0);
^
--
fs/dcache.c:1634:23: warning: Possible null pointer dereference: name [nullPointer]
dentry->d_name.len = name->len;
^
fs/dcache.c:1705:50: note: Calling function '__d_alloc', 2nd argument
'NULL' value is 0
struct dentry *dentry = __d_alloc(parent->d_sb, NULL);
^
fs/dcache.c:1634:23: note: Null pointer dereference
dentry->d_name.len = name->len;
^
fs/dcache.c:1635:24: warning: Possible null pointer dereference: name [nullPointer]
dentry->d_name.hash = name->hash;
^
fs/dcache.c:1705:50: note: Calling function '__d_alloc', 2nd argument
'NULL' value is 0
struct dentry *dentry = __d_alloc(parent->d_sb, NULL);
^
fs/dcache.c:1635:24: note: Null pointer dereference
dentry->d_name.hash = name->hash;
^
fs/dcache.c:1636:16: warning: Possible null pointer dereference: name [nullPointer]
memcpy(dname, name->name, name->len);
^
fs/dcache.c:1705:50: note: Calling function '__d_alloc', 2nd argument
'NULL' value is 0
struct dentry *dentry = __d_alloc(parent->d_sb, NULL);
^
fs/dcache.c:1636:16: note: Null pointer dereference
memcpy(dname, name->name, name->len);
^
fs/dcache.c:1637:8: warning: Possible null pointer dereference: name [nullPointer]
dname[name->len] = 0;
^
fs/dcache.c:1705:50: note: Calling function '__d_alloc', 2nd argument
'NULL' value is 0
struct dentry *dentry = __d_alloc(parent->d_sb, NULL);
^
fs/dcache.c:1637:8: note: Null pointer dereference
dname[name->len] = 0;
^
fs/dcache.c:2948:6: warning: Variable 'ret' is reassigned a value before the
old one has been used. [redundantAssignment]
ret = 0;
^
fs/dcache.c:2933:0: note: Variable 'ret' is reassigned a value before the old
one has been used.
int ret = -ESTALE;
^
fs/dcache.c:2948:6: note: Variable 'ret' is reassigned a value before the old
one has been used.
ret = 0;
^
> fs/dcache.c:3125:18: warning: Local variable parent shadows outer
variable [shadowVar]
struct mount *parent = ACCESS_ONCE(mnt->mnt_parent);
^
fs/dcache.c:3122:19: note: Shadowed declaration
struct dentry * parent;
^
fs/dcache.c:3125:18: note: Shadow variable
struct mount *parent = ACCESS_ONCE(mnt->mnt_parent);
^
--
> fs/crypto/crypto.c:313:6: warning: Variable 'err' is
reassigned a value before the old one has been used. [redundantAssignment]
err =
0;
^
fs/crypto/crypto.c:307:6: note: Variable 'err' is reassigned a value before the
old one has been used.
err = -ENOMEM;
^
fs/crypto/crypto.c:313:6: note: Variable 'err' is reassigned a value before the
old one has been used.
err = 0;
^
fs/crypto/crypto.c:366:6: warning: Variable 'err' is reassigned a value before
the old one has been used. [redundantAssignment]
err = fscrypt_init_keyring();
^
fs/crypto/crypto.c:346:0: note: Variable 'err' is reassigned a value before the
old one has been used.
int err = -ENOMEM;
^
fs/crypto/crypto.c:366:6: note: Variable 'err' is reassigned a value before the
old one has been used.
err = fscrypt_init_keyring();
^
> fs/crypto/crypto.c:100:23: warning: Checking if unsigned variable
'len' is less than zero. [unsignedLessThanZero]
if (WARN_ON_ONCE(len
<= 0))
^
fs/crypto/crypto.c:170:23: warning: Checking if unsigned variable 'len' is less
than zero. [unsignedLessThanZero]
if (WARN_ON_ONCE(len <= 0 || !IS_ALIGNED(len | offs, blocksize)))
^
fs/crypto/crypto.c:248:23: warning: Checking if unsigned variable 'len' is less
than zero. [unsignedLessThanZero]
if (WARN_ON_ONCE(len <= 0 || !IS_ALIGNED(len | offs, blocksize)))
^
--
> fs/crypto/keyring.c:670:6: warning: Variable 'err' is
reassigned a value before the old one has been used. 'break;' missing?
[redundantAssignInSwitch]
err = add_master_key(sb, &secret,
&arg.key_spec);
^
fs/crypto/keyring.c:624:7: note: Variable 'err' is reassigned a value before
the old one has been used. 'break;' missing?
err = -EFAULT;
^
fs/crypto/keyring.c:670:6: note: Variable 'err' is reassigned a value before
the old one has been used. 'break;' missing?
err = add_master_key(sb, &secret, &arg.key_spec);
^
> fs/crypto/keyring.c:670:6: warning: Variable 'err' is
reassigned a value before the old one has been used. 'break;' missing?
[redundantAssignInSwitch]
err = add_master_key(sb, &secret,
&arg.key_spec);
^
fs/crypto/keyring.c:636:7: note: Variable 'err' is reassigned a value before
the old one has been used. 'break;' missing?
err = -EACCES;
^
fs/crypto/keyring.c:670:6: note: Variable 'err' is reassigned a value before
the old one has been used. 'break;' missing?
err = add_master_key(sb, &secret, &arg.key_spec);
^
> fs/crypto/keyring.c:670:6: warning: Variable 'err' is
reassigned a value before the old one has been used. [redundantAssignment]
err =
add_master_key(sb, &secret, &arg.key_spec);
^
fs/crypto/keyring.c:658:7: note: Variable 'err' is reassigned a value before
the old one has been used.
err = -EFAULT;
^
fs/crypto/keyring.c:670:6: note: Variable 'err' is reassigned a value before
the old one has been used.
err = add_master_key(sb, &secret, &arg.key_spec);
^
> fs/crypto/bio.c:96:23: warning: Checking if unsigned variable
'nr_pages' is less than zero. [unsignedLessThanZero]
if
(WARN_ON(nr_pages <= 0))
^
--
In file included from fs/ext4/extents.c:
> fs/ext4/ext4_extents.h:201:22: warning: Either the condition
'!ex' is redundant or there is possible null pointer dereference: ext.
[nullPointerRedundantCheck]
return (le16_to_cpu(ext->ee_len) >
EXT_INIT_MAX_LEN);
^
fs/ext4/extents.c:2196:7: note: Assuming that condition '!ex' is not redundant
if (!ex) {
^
fs/ext4/extents.c:2238:30: note: Calling function 'ext4_ext_is_unwritten', 1st
argument 'ex' value is 0
if (ext4_ext_is_unwritten(ex))
^
fs/ext4/ext4_extents.h:201:22: note: Null pointer dereference
return (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN);
^
fs/ext4/ext4_extents.h:206:22: warning: Either the condition '!ex' is redundant
or there is possible null pointer dereference: ext. [nullPointerRedundantCheck]
return (le16_to_cpu(ext->ee_len) <= EXT_INIT_MAX_LEN ?
^
fs/ext4/extents.c:2196:7: note: Assuming that condition '!ex' is not redundant
if (!ex) {
^
fs/ext4/extents.c:2236:40: note: Calling function 'ext4_ext_get_actual_len',
1st argument 'ex' value is 0
es.es_len = ext4_ext_get_actual_len(ex);
^
fs/ext4/ext4_extents.h:206:22: note: Null pointer dereference
return (le16_to_cpu(ext->ee_len) <= EXT_INIT_MAX_LEN ?
^
fs/ext4/ext4_extents.h:207:15: warning: Either the condition '!ex' is redundant
or there is possible null pointer dereference: ext. [nullPointerRedundantCheck]
le16_to_cpu(ext->ee_len) :
^
fs/ext4/extents.c:2196:7: note: Assuming that condition '!ex' is not redundant
if (!ex) {
^
fs/ext4/extents.c:2236:40: note: Calling function 'ext4_ext_get_actual_len',
1st argument 'ex' value is 0
es.es_len = ext4_ext_get_actual_len(ex);
^
fs/ext4/ext4_extents.h:207:15: note: Null pointer dereference
le16_to_cpu(ext->ee_len) :
^
fs/ext4/ext4_extents.h:208:16: warning: Either the condition '!ex' is redundant
or there is possible null pointer dereference: ext. [nullPointerRedundantCheck]
(le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN));
^
fs/ext4/extents.c:2196:7: note: Assuming that condition '!ex' is not redundant
if (!ex) {
^
fs/ext4/extents.c:2236:40: note: Calling function 'ext4_ext_get_actual_len',
1st argument 'ex' value is 0
es.es_len = ext4_ext_get_actual_len(ex);
^
fs/ext4/ext4_extents.h:208:16: note: Null pointer dereference
(le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN));
^
> fs/ext4/ext4_extents.h:224:22: warning: Either the condition
'!ex' is redundant or there is possible null pointer dereference: ex.
[nullPointerRedundantCheck]
block = le32_to_cpu(ex->ee_start_lo);
^
fs/ext4/extents.c:2196:7: note: Assuming that condition '!ex' is not redundant
if (!ex) {
^
fs/ext4/extents.c:2237:33: note: Calling function 'ext4_ext_pblock', 1st
argument 'ex' value is 0
es.es_pblk = ext4_ext_pblock(ex);
^
fs/ext4/ext4_extents.h:224:22: note: Null pointer dereference
block = le32_to_cpu(ex->ee_start_lo);
^
fs/ext4/ext4_extents.h:225:39: warning: Either the condition '!ex' is redundant
or there is possible null pointer dereference: ex. [nullPointerRedundantCheck]
block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1;
^
fs/ext4/extents.c:2196:7: note: Assuming that condition '!ex' is not redundant
if (!ex) {
^
fs/ext4/extents.c:2237:33: note: Calling function 'ext4_ext_pblock', 1st
argument 'ex' value is 0
es.es_pblk = ext4_ext_pblock(ex);
^
fs/ext4/ext4_extents.h:225:39: note: Null pointer dereference
block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1;
^
> fs/ext4/extents.c:2235:29: warning: Either the condition
'!ex' is redundant or there is possible null pointer dereference: ex.
[nullPointerRedundantCheck]
es.es_lblk = le32_to_cpu(ex->ee_block);
^
fs/ext4/extents.c:2196:7: note: Assuming that condition '!ex' is not redundant
if (!ex) {
^
fs/ext4/extents.c:2235:29: note: Null pointer dereference
es.es_lblk = le32_to_cpu(ex->ee_block);
^
> fs/ext4/extents.c:5180:9: warning: Variable 'error' is
reassigned a value before the old one has been used. [redundantAssignment]
error = ext4_xattr_fiemap(inode, fieinfo);
^
fs/ext4/extents.c:5158:9: note: Variable 'error' is reassigned a value before
the old one has been used.
error = ext4_inline_data_fiemap(inode, fieinfo, &has_inline,
^
fs/ext4/extents.c:5180:9: note: Variable 'error' is reassigned a value before
the old one has been used.
error = ext4_xattr_fiemap(inode, fieinfo);
^
fs/ext4/ext4.h:517:2: warning: Shifting signed 32-bit value by 31 bits is undefined
behaviour [shiftTooManyBitsSigned]
CHECK_FLAG_VALUE(RESERVED);
^
> fs/ext4/extents.c:4503:59: warning: Clarify calculation
precedence for '&' and '?'. [clarifyCalculation]
int
fb_flags = flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE ?
^
> fs/ext4/extents.c:2535:24: warning: Local variable sbi shadows
outer variable [shadowVar]
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
^
fs/ext4/extents.c:2504:23: note: Shadowed declaration
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
^
fs/ext4/extents.c:2535:24: note: Shadow variable
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
^
> fs/ext4/file.c:531:12: warning: Variable 'lastoff' is
reassigned a value before the old one has been used. [redundantAssignment]
lastoff = page_offset(page) + PAGE_SIZE;
^
fs/ext4/file.c:526:14: note: Variable 'lastoff' is reassigned a value before
the old one has been used.
lastoff += bh->b_size;
^
fs/ext4/file.c:531:12: note: Variable 'lastoff' is reassigned a value before
the old one has been used.
lastoff = page_offset(page) + PAGE_SIZE;
^
fs/ext4/ext4.h:517:2: warning: Shifting signed 32-bit value by 31 bits is undefined
behaviour [shiftTooManyBitsSigned]
CHECK_FLAG_VALUE(RESERVED);
^
fs/ext4/ialloc.c:994:6: warning: Variable 'err' is reassigned a value before
the old one has been used. [redundantAssignment]
err = -ENOSPC;
^
fs/ext4/ialloc.c:905:6: note: Variable 'err' is reassigned a value before the
old one has been used.
err = -ENOSPC;
^
fs/ext4/ialloc.c:994:6: note: Variable 'err' is reassigned a value before the
old one has been used.
err = -ENOSPC;
^
fs/ext4/ialloc.c:964:7: warning: Variable 'err' is reassigned a value before
the old one has been used. [redundantAssignment]
err = ext4_journal_get_write_access(handle, inode_bitmap_bh);
^
fs/ext4/ialloc.c:915:7: note: Variable 'err' is reassigned a value before the
old one has been used.
err = -EIO;
^
fs/ext4/ialloc.c:964:7: note: Variable 'err' is reassigned a value before the
old one has been used.
err = ext4_journal_get_write_access(handle, inode_bitmap_bh);
^
> fs/ext4/ialloc.c:375:8: warning: Local variable count shadows
outer variable [shadowVar]
int count;
^
fs/ext4/ialloc.c:268:22: note: Shadowed declaration
int fatal = 0, err, count, cleared;
^
fs/ext4/ialloc.c:375:8: note: Shadow variable
int count;
^
fs/ext4/ialloc.c:1055:27: warning: Local variable grp shadows outer variable
[shadowVar]
struct ext4_group_info *grp = ext4_get_group_info(sb, group);
^
fs/ext4/ialloc.c:791:26: note: Shadowed declaration
struct ext4_group_info *grp;
^
fs/ext4/ialloc.c:1055:27: note: Shadow variable
struct ext4_group_info *grp = ext4_get_group_info(sb, group);
^
fs/ext4/ext4.h:517:2: warning: Shifting signed 32-bit value by 31 bits is undefined
behaviour [shiftTooManyBitsSigned]
CHECK_FLAG_VALUE(RESERVED);
^
fs/ext4/ialloc.c:966:4: warning: Identical inner 'if' condition is always true.
[identicalInnerCondition]
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:965:7: note: outer condition: err
if (err) {
^
fs/ext4/ialloc.c:966:4: note: identical inner condition: err
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1001:3: warning: Identical inner 'if' condition is always
true. [identicalInnerCondition]
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1000:6: note: outer condition: err
if (err) {
^
fs/ext4/ialloc.c:1001:3: note: identical inner condition: err
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1008:3: warning: Identical inner 'if' condition is always
true. [identicalInnerCondition]
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1007:6: note: outer condition: err
if (err) {
^
fs/ext4/ialloc.c:1008:3: note: identical inner condition: err
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1026:4: warning: Identical inner 'if' condition is always
true. [identicalInnerCondition]
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1024:7: note: outer condition: err
if (err) {
^
fs/ext4/ialloc.c:1026:4: note: identical inner condition: err
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1047:4: warning: Identical inner 'if' condition is always
true. [identicalInnerCondition]
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1046:7: note: outer condition: err
if (err) {
^
fs/ext4/ialloc.c:1047:4: note: identical inner condition: err
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1097:3: warning: Identical inner 'if' condition is always
true. [identicalInnerCondition]
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1096:6: note: outer condition: err
if (err) {
^
fs/ext4/ialloc.c:1097:3: note: identical inner condition: err
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1205:3: warning: Identical inner 'if' condition is always
true. [identicalInnerCondition]
ext4_std_error(sb, err);
^
fs/ext4/ialloc.c:1204:6: note: outer condition: err
if (err) {
^
fs/ext4/ialloc.c:1205:3: note: identical inner condition: err
ext4_std_error(sb, err);
^
> fs/ext4/sysfs.c:294:24: warning: Either the condition
'!ptr' is redundant or there is possible null pointer dereference: ptr.
[nullPointerRedundantCheck]
*((unsigned int *) ptr));
^
fs/ext4/sysfs.c:296:7: note: Assuming that condition '!ptr' is not redundant
if (!ptr)
^
fs/ext4/sysfs.c:294:24: note: Null pointer dereference
*((unsigned int *) ptr));
^
fs/ext4/ext4.h:517:2: warning: Shifting signed 32-bit value by 31 bits is undefined
behaviour [shiftTooManyBitsSigned]
CHECK_FLAG_VALUE(RESERVED);
^
> fs/f2fs/xattr.c:73:2: warning: Non-boolean value returned from
function returning bool [returnNonBoolInBooleanFunction]
return test_opt(sbi,
XATTR_USER);
^
fs/f2fs/f2fs.h:2126:15: warning: Local variable valid_node_count shadows outer function
[shadowFunction]
unsigned int valid_node_count, user_block_count;
^
fs/f2fs/f2fs.h:2222:28: note: Shadowed declaration
static inline unsigned int valid_node_count(struct f2fs_sb_info *sbi)
^
fs/f2fs/f2fs.h:2126:15: note: Shadow variable
unsigned int valid_node_count, user_block_count;
^
> fs/gfs2/aops.c:739:8: warning: Variable 'error' is
reassigned a value before the old one has been used. [redundantAssignment]
error
= __block_write_begin(page, from, len, gfs2_block_map);
^
fs/gfs2/aops.c:719:8: note: Variable 'error' is reassigned a value before the
old one has been used.
error = -ENOMEM;
^
fs/gfs2/aops.c:739:8: note: Variable 'error' is reassigned a value before the
old one has been used.
error = __block_write_begin(page, from, len, gfs2_block_map);
^
> fs/nilfs2/bmap.h:194:2: warning: Possible null pointer
dereference: req [nullPointer]
req->bpr_ptr =
bmap->b_last_allocated_ptr++;
^
fs/nilfs2/btree.c:1877:8: note: Assignment 'di=NULL', assigned value is 0
di = NULL;
^
fs/nilfs2/btree.c:1882:59: note: Calling function
'nilfs_btree_prepare_convert_and_insert', 3rd argument 'di' value is 0
ret = nilfs_btree_prepare_convert_and_insert(btree, key, di, ni, &bh,
^
fs/nilfs2/btree.c:1754:44: note: Calling function
'nilfs_bmap_prepare_alloc_ptr', 2nd argument 'dreq' value is 0
ret = nilfs_bmap_prepare_alloc_ptr(btree, dreq, dat);
^
fs/nilfs2/bmap.h:194:2: note: Null pointer dereference
req->bpr_ptr = bmap->b_last_allocated_ptr++;
^
vim +/nr_pages +96 fs/crypto/bio.c
43
44 /**
45 * fscrypt_zeroout_range() - zero out a range of blocks in an encrypted file
46 * @inode: the file's inode
47 * @lblk: the first file logical block to zero out
48 * @pblk: the first filesystem physical block to zero out
49 * @len: number of blocks to zero out
50 *
51 * Zero out filesystem blocks in an encrypted regular file on-disk, i.e. write
52 * ciphertext blocks which decrypt to the all-zeroes block. The blocks must be
53 * both logically and physically contiguous. It's also assumed that the
54 * filesystem only uses a single block device, ->s_bdev.
55 *
56 * Note that since each block uses a different IV, this involves writing a
57 * different ciphertext to each block; we can't simply reuse the same one.
58 *
59 * Return: 0 on success; -errno on failure.
60 */
61 int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
62 sector_t pblk, unsigned int len)
63 {
64 const unsigned int blockbits = inode->i_blkbits;
65 const unsigned int blocksize = 1 << blockbits;
66 const unsigned int blocks_per_page_bits = PAGE_SHIFT - blockbits;
67 const unsigned int blocks_per_page = 1 << blocks_per_page_bits;
68 struct page *pages[16]; /* write up to 16 pages at a time */
69 unsigned int nr_pages;
70 unsigned int i;
71 unsigned int offset;
72 struct bio *bio;
73 int ret, err;
74
75 if (len == 0)
76 return 0;
77
78 BUILD_BUG_ON(ARRAY_SIZE(pages) > BIO_MAX_PAGES);
79 nr_pages = min_t(unsigned int, ARRAY_SIZE(pages),
80 (len + blocks_per_page - 1) >> blocks_per_page_bits);
81
82 /*
83 * We need at least one page for ciphertext. Allocate the first one
84 * from a mempool, with __GFP_DIRECT_RECLAIM set so that it can't fail.
85 *
86 * Any additional page allocations are allowed to fail, as they only
87 * help performance, and waiting on the mempool for them could deadlock.
88 */
89 for (i = 0; i < nr_pages; i++) {
90 pages[i] = fscrypt_alloc_bounce_page(i == 0 ? GFP_NOFS :
91 GFP_NOWAIT | __GFP_NOWARN);
92 if (!pages[i])
93 break;
94 }
95 nr_pages = i;
96 if (WARN_ON(nr_pages <= 0))
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org