aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2010-11-21 22:27:44 -0500
committerChris Mason <chris.mason@oracle.com>2010-11-21 22:27:44 -0500
commit45f49bce99d008d6864a20324548f35936ba46fb (patch)
tree9bae14a5fa0b68573758dcc1aaaa176f4a62c6b8 /fs/btrfs
parenta1b075d28da563c5e2325577f282c042494254ba (diff)
Btrfs: avoid NULL pointer deref in try_release_extent_buffer
If we fail to find a pointer in the radix tree, don't try to deref the NULL one we do have. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent_io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index f60aa3c35c23..143d3f541d64 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3837,8 +3837,10 @@ int try_release_extent_buffer(struct extent_io_tree *tree, struct page *page)
3837 3837
3838 spin_lock(&tree->buffer_lock); 3838 spin_lock(&tree->buffer_lock);
3839 eb = radix_tree_lookup(&tree->buffer, start >> PAGE_CACHE_SHIFT); 3839 eb = radix_tree_lookup(&tree->buffer, start >> PAGE_CACHE_SHIFT);
3840 if (!eb) 3840 if (!eb) {
3841 goto out; 3841 spin_unlock(&tree->buffer_lock);
3842 return ret;
3843 }
3842 3844
3843 if (test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags)) { 3845 if (test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags)) {
3844 ret = 0; 3846 ret = 0;