summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2015-10-22 10:56:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-11-09 12:50:25 -0800
commitbb601ba313dd3b1a7fd78b6a64b6b069627afda5 (patch)
tree7b62c2372a923c68d4b57d3e09d45e53a00bdcff
parent36ce17424c89564f46ac535d666a5d4973678c5a (diff)
downloadlinux-stable-bb601ba313dd3b1a7fd78b6a64b6b069627afda5.tar.gz
linux-stable-bb601ba313dd3b1a7fd78b6a64b6b069627afda5.tar.bz2
linux-stable-bb601ba313dd3b1a7fd78b6a64b6b069627afda5.zip
dm btree: fix leak of bufio-backed block in btree_split_beneath error path
commit 4dcb8b57df3593dcb20481d9d6cf79d1dc1534be upstream. btree_split_beneath()'s error path had an outstanding FIXME that speaks directly to the potential for _not_ cleaning up a previously allocated bufio-backed block. Fix this by releasing the previously allocated bufio block using unlock_block(). Reported-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Joe Thornber <thornber@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/md/persistent-data/dm-btree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c
index c7726cebc495..d6e47033b5e0 100644
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -523,7 +523,7 @@ static int btree_split_beneath(struct shadow_spine *s, uint64_t key)
r = new_block(s->info, &right);
if (r < 0) {
- /* FIXME: put left */
+ unlock_block(s->info, left);
return r;
}