diff options
author | Mike Snitzer <snitzer@redhat.com> | 2015-10-22 10:56:40 -0400 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-11-12 14:08:59 +0100 |
commit | 76dff47884e6806e2dd71f7b9a12a4f99a344e0a (patch) | |
tree | 7c0c90cf30072e1f384363f80b59f727e49febec | |
parent | b865892e2e90302fa2e4613c181772c8659ea34e (diff) | |
download | lwn-76dff47884e6806e2dd71f7b9a12a4f99a344e0a.tar.gz lwn-76dff47884e6806e2dd71f7b9a12a4f99a344e0a.zip |
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: Jiri Slaby <jslaby@suse.cz>
-rw-r--r-- | drivers/md/persistent-data/dm-btree.c | 2 |
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 50cf11119af9..fc3d733aab1c 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; } |