Skip to content

Commit

Permalink
btrfs: fix dereference of ERR_PTR value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Sterba authored and Chris Mason committed Jun 17, 2011
1 parent e038dca commit 3ed4498
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/tree-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3ed4498

Please sign in to comment.