Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45f49bce authored by Chris Mason's avatar Chris Mason
Browse files

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: default avatarChris Mason <chris.mason@oracle.com>
parent a1b075d2
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -3837,8 +3837,10 @@ int try_release_extent_buffer(struct extent_io_tree *tree, struct page *page)


	spin_lock(&tree->buffer_lock);
	spin_lock(&tree->buffer_lock);
	eb = radix_tree_lookup(&tree->buffer, start >> PAGE_CACHE_SHIFT);
	eb = radix_tree_lookup(&tree->buffer, start >> PAGE_CACHE_SHIFT);
	if (!eb)
	if (!eb) {
		goto out;
		spin_unlock(&tree->buffer_lock);
		return ret;
	}


	if (test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags)) {
	if (test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags)) {
		ret = 0;
		ret = 0;