Skip to content

Commit

Permalink
Btrfs: adjust NULL test
Browse files Browse the repository at this point in the history
Move the call to BUG_ON to before the dereference of the tested value.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Julia Lawall authored and Chris Mason committed Jul 22, 2009
1 parent 3acada4 commit 33c17ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 33c17ad

Please sign in to comment.