diff mbox series

ext4: fix odd_ptr_err.cocci warnings

Message ID 20181120133640.GA59775@lkp-sb-ep06
State Superseded
Headers show
Series ext4: fix odd_ptr_err.cocci warnings | expand

Commit Message

kbuild test robot Nov. 20, 2018, 1:36 p.m. UTC
From: kbuild test robot <fengguang.wu@intel.com>

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@mit.edu>
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
---

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(-)
diff mbox series

Patch

--- 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;
 		}