diff mbox

Avoid a NULL pointer in btrfs

Message ID 4D36F04D.70505@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

liu weni Jan. 19, 2011, 2:08 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 5e7a94d..0da42b5 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1553,6 +1553,9 @@  int test_range_bit(struct extent_io_tree *tree,
u64 start, u64 end,
struct rb_node *node;
int bitset = 0;

+ if (tree == NULL)
+ return bitset;
+
spin_lock(&tree->lock);
if (cached && cached->tree && cached->start == start)