Explorar o código

btrfs: fix dereference of ERR_PTR value

smatch reports:

btrfs_recover_log_trees error: 'wc.replay_dest' dereferencing
possible ERR_PTR()

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
David Sterba %!s(int64=14) %!d(string=hai) anos
pai
achega
3ed4498caf
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      fs/btrfs/tree-log.c

+ 1 - 1
fs/btrfs/tree-log.c

@@ -3177,7 +3177,7 @@ again:
 		tmp_key.offset = (u64)-1;
 
 		wc.replay_dest = btrfs_read_fs_root_no_name(fs_info, &tmp_key);
-		BUG_ON(!wc.replay_dest);
+		BUG_ON(IS_ERR_OR_NULL(wc.replay_dest));
 
 		wc.replay_dest->log_root = log;
 		btrfs_record_root_in_trans(trans, wc.replay_dest);