linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] blk-mq: fix leak of q->stats
@ 2017-03-27 17:43 Omar Sandoval
  2017-03-27 17:43 ` [PATCH 2/2] block: fix leak of q->rq_wb Omar Sandoval
  2017-03-28  2:43 ` [PATCH 1/2] blk-mq: fix leak of q->stats Ming Lei
  0 siblings, 2 replies; 6+ messages in thread
From: Omar Sandoval @ 2017-03-27 17:43 UTC (permalink / raw)
  To: linux-block; +Cc: kernel-team

From: Omar Sandoval <osandov@fb.com>

blk_alloc_queue_node() already allocates q->stats, so
blk_mq_init_allocated_queue() is overwriting it with a new allocation.

Fixes: a83b576c9c25 ("block: fix stacked driver stats init and free")
Signed-off-by: Omar Sandoval <osandov@fb.com>
---
 block/blk-mq.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index c212b9644a9f..9c6b39bd8358 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2212,10 +2212,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)
-- 
2.12.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-28  3:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-27 17:43 [PATCH 1/2] blk-mq: fix leak of q->stats Omar Sandoval
2017-03-27 17:43 ` [PATCH 2/2] block: fix leak of q->rq_wb Omar Sandoval
2017-03-28  2:52   ` Omar Sandoval
2017-03-28  3:43   ` Ming Lei
2017-03-28  3:45     ` Omar Sandoval
2017-03-28  2:43 ` [PATCH 1/2] blk-mq: fix leak of q->stats Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).