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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Feb 2016 22:22:37 +0000 (14:22 -0800)
commitd6671b052b3d6a885d0fa53d553b71c3d492ba62
tree771a7bd027084cb705e74b2e03ba67a97b763255
parentdaaf3fd914414d67fd656a39c0f1575c07f02985
dm btree: fix leak of bufio-backed block in btree_split_sibling error path

commit 30ce6e1cc5a0f781d60227e9096c86e188d2c2bd upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/persistent-data/dm-btree.c