[PATCH] ext4: fix odd_ptr_err.cocci warnings

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

 



From: kbuild test robot <fengguang.wu@xxxxxxxxx>

fs/ext4/resize.c:999:6-12: inconsistent IS_ERR and PTR_ERR on line 1000.

 PTR_ERR should access the value just tested by IS_ERR

Semantic patch information:
 There can be false positives in the patch case, where it is the call to
 IS_ERR that is wrong.

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

Fixes: 0212baa67119 ("ext4: add ext4_sb_bread() to disambiguate ENOMEM cases")
CC: Theodore Ts'o <tytso@xxxxxxx>
Signed-off-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
---

url:    https://github.com/0day-ci/linux/commits/Theodore-Ts-o/ext4-add-ext4_sb_bread-to-disambiguate-ENOMEM-cases/20181120-070629
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev

Please take the patch only if it's a positive warning. Thanks!

 resize.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -997,7 +997,7 @@ static int reserve_backup_gdb(handle_t *
 		}
 		primary[res] = ext4_sb_bread(sb, blk);
 		if (IS_ERR(primary[res])) {
-			err = PTR_ERR(res);
+			err = PTR_ERR(primary[res]);
 			primary[res] = NULL;
 			goto exit_bh;
 		}



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux