Re: [PATCH] blk-mq: fix double-free in error path

2015-02-11 Thread Jens Axboe
On 02/11/2015 09:32 AM, Tony Battersby wrote: 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: Signed-off-by: Ton

[PATCH] blk-mq: fix double-free in error path

2015-02-11 Thread Tony Battersby
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: Signed-off-by: Tony Battersby --- For inclusion in kernel 3.20.