提交 37e11c36 编写于 作者: M Ming Lei 提交者: Jens Axboe

block: call blk_exit_queue() before freeing q->stats

blk_stat_disable_accounting() is added in commit 68497092
("block: make queue stat accounting a reference"), and called in
kyber_exit_sched().

So we have to free q->stats after elevator is unloaded from
blk_exit_queue() in blk_release_queue(). Otherwise kernel panic
is caused.

Fixes: 68497092 ("block: make queue stat accounting a reference")
Signed-off-by: NMing Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20211221040436.1333880-1-ming.lei@redhat.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 a957b612
......@@ -791,11 +791,11 @@ static void blk_release_queue(struct kobject *kobj)
blk_stat_remove_callback(q, q->poll_cb);
blk_stat_free_callback(q->poll_cb);
blk_exit_queue(q);
blk_free_queue_stats(q->stats);
kfree(q->poll_stat);
blk_exit_queue(q);
blk_queue_free_zone_bitmaps(q);
if (queue_is_mq(q))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册