Skip to content

Commit

Permalink
blk-mq: fix leak of q->stats
Browse files Browse the repository at this point in the history
blk_alloc_queue_node() already allocates q->stats, so
blk_mq_init_allocated_queue() is overwriting it with a new allocation.

Fixes: a83b576 ("block: fix stacked driver stats init and free")
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Omar Sandoval authored and Jens Axboe committed Mar 29, 2017
1 parent 334335d commit 0c9539a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2234,10 +2234,6 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
/* mark the queue as mq asap */
q->mq_ops = set->ops;

q->stats = blk_alloc_queue_stats();
if (!q->stats)
goto err_exit;

q->poll_cb = blk_stat_alloc_callback(blk_mq_poll_stats_fn,
blk_stat_rq_ddir, 2, q);
if (!q->poll_cb)
Expand Down

0 comments on commit 0c9539a

Please sign in to comment.