From: Julia Lawall Date: Wed, 22 Jul 2009 20:49:01 +0000 (-0400) Subject: Btrfs: adjust NULL test X-Git-Tag: v2.6.31-rc5~7^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33c17ad5717c887568c1de61f15e5d58ed66d189;p=platform%2Fkernel%2Flinux-stable.git Btrfs: adjust NULL test Move the call to BUG_ON to before the dereference of the tested value. Signed-off-by: Julia Lawall Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index a48c084..3ea827d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2607,8 +2607,8 @@ noinline int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, if (root->ref_cows) btrfs_drop_extent_cache(inode, new_size & (~mask), (u64)-1, 0); path = btrfs_alloc_path(); - path->reada = -1; BUG_ON(!path); + path->reada = -1; /* FIXME, add redo link to tree so we don't leak on crash */ key.objectid = inode->i_ino;