From: David Sterba Date: Mon, 13 Jun 2011 17:54:22 +0000 (+0000) Subject: btrfs: fix dereference of ERR_PTR value X-Git-Tag: 2.1b_release~3505^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ed4498caf381a73d6259d3ffacc914b17a507ec;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git 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 Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 592396c..4ce8a9f 100644 --- a/fs/btrfs/tree-log.c +++ b/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);