dm btree: fix leak of bufio-backed block in btree_split_sibling error path
authorMike Snitzer <snitzer@redhat.com>
Mon, 23 Nov 2015 21:24:45 +0000 (16:24 -0500)
committerMike Snitzer <snitzer@redhat.com>
Wed, 2 Dec 2015 18:20:34 +0000 (13:20 -0500)
commit30ce6e1cc5a0f781d60227e9096c86e188d2c2bd
tree4d1217d25ff2d2e6db70e11a04ce52f82a781cb8
parent31ade3b83e1821da5fbb2f11b5b3d4ab2ec39db8
dm btree: fix leak of bufio-backed block in btree_split_sibling error path

The block allocated at the start of btree_split_sibling() is never
released if later insert_at() fails.

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>
Cc: stable@vger.kernel.org
drivers/md/persistent-data/dm-btree.c