aboutsummaryrefslogtreecommitdiff
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 10:12:58 -0800
commit0dcb59bb43fab56440c3238a738fd43e0373c4f0 (patch)
tree744682a687068d8c637dfb3cc76fe9672cc178b1
parent9d194973fc99e5a5bbc556a4bd0085d3a17ac687 (diff)
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 79233b051da0..b53669404cb5 100644
--- a/drivers/md/persistent-data/dm-btree.c
+++ b/drivers/md/persistent-data/dm-btree.c
@@ -507,7 +507,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;
}