dm btree: fix leak of bufio-backed block in btree_split_beneath error path
authorMike Snitzer <snitzer@redhat.com>
Thu, 22 Oct 2015 14:56:40 +0000 (10:56 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Nov 2015 22:33:37 +0000 (14:33 -0800)
commit8104ee7b8f8bcfad0114cdad62dd3b4aea5fcf74
tree1ae0fe3009e18f1928acea4eeec4a68337ec4de6
parentf043d45591b6a6fd4ae2888a5dbbb53f8e50153b
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>
drivers/md/persistent-data/dm-btree.c