Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ed4498c authored by David Sterba's avatar David Sterba Committed by Chris Mason
Browse files

btrfs: fix dereference of ERR_PTR value



smatch reports:

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

Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent e038dca8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3177,7 +3177,7 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
		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);