blk-mq: fix double-free in error path
authorTony Battersby <tonyb@cybernetics.com>
Wed, 11 Feb 2015 16:32:30 +0000 (11:32 -0500)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:58 +0000 (12:54 -0600)
commitac165e5e12e4eac9123d018311c278c974cf9093
treea50ecea0657f4f44ee6e49e4f5eb38e5862de8b1
parentfa7b53ea105a193edb1d26a65e6bd2b48b71fc47
blk-mq: fix double-free in error path

If the allocation of bt->bs fails, then bt->map can be freed twice, once
in blk_mq_init_bitmap_tags() -> bt_alloc(), and once in
blk_mq_init_bitmap_tags() -> bt_free().  Fix by setting the pointer to
NULL after the first free.

Cc: <stable@vger.kernel.org>
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq-tag.c