From: Mike Snitzer Date: Thu, 22 Oct 2015 14:56:40 +0000 (-0400) Subject: dm btree: fix leak of bufio-backed block in btree_split_beneath error path X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=4dcb8b57df3593dcb20481d9d6cf79d1dc1534be;p=openwrt%2Fstaging%2Fblogic.git dm btree: fix leak of bufio-backed block in btree_split_beneath error path 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 Signed-off-by: Mike Snitzer Acked-by: Joe Thornber Cc: stable@vger.kernel.org --- diff --git a/drivers/md/persistent-data/dm-btree.c b/drivers/md/persistent-data/dm-btree.c index b6cec258cc21..0e09aef43998 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; }