diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2011-01-04 21:32:22 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-01-16 11:30:20 -0500 |
commit | 91ca338d776e0cefb255bf2979b6448febd880f5 (patch) | |
tree | 5d1d344d6ed565faf5612b5c695f00c04e6f01d8 /fs/btrfs/ctree.c | |
parent | ff175d57f057f77d2d3031d674c2af9167a4af02 (diff) |
btrfs: check NULL or not
Should check if functions returns NULL or not.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 99599f1c1554..b5baff0dccfe 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -2516,6 +2516,9 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root | |||
2516 | btrfs_assert_tree_locked(path->nodes[1]); | 2516 | btrfs_assert_tree_locked(path->nodes[1]); |
2517 | 2517 | ||
2518 | right = read_node_slot(root, upper, slot + 1); | 2518 | right = read_node_slot(root, upper, slot + 1); |
2519 | if (right == NULL) | ||
2520 | return 1; | ||
2521 | |||
2519 | btrfs_tree_lock(right); | 2522 | btrfs_tree_lock(right); |
2520 | btrfs_set_lock_blocking(right); | 2523 | btrfs_set_lock_blocking(right); |
2521 | 2524 | ||
@@ -2766,6 +2769,9 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root | |||
2766 | btrfs_assert_tree_locked(path->nodes[1]); | 2769 | btrfs_assert_tree_locked(path->nodes[1]); |
2767 | 2770 | ||
2768 | left = read_node_slot(root, path->nodes[1], slot - 1); | 2771 | left = read_node_slot(root, path->nodes[1], slot - 1); |
2772 | if (left == NULL) | ||
2773 | return 1; | ||
2774 | |||
2769 | btrfs_tree_lock(left); | 2775 | btrfs_tree_lock(left); |
2770 | btrfs_set_lock_blocking(left); | 2776 | btrfs_set_lock_blocking(left); |
2771 | 2777 | ||