Commit d8b257f1 authored by Li Nan's avatar Li Nan Committed by openeuler-sync-bot
Browse files

block: fix order error in blk_release_queue

hulk inclusion
category: bugfix, https://gitee.com/openeuler/kernel/issues/I64SY5


bugzilla: 188093
CVE: NA

--------------------------------

blk_stat_free_callback() will check stats->callbacks, and wbt's callback
is freed in wbt_exit(), which is called by rq_qos_exit(). So move it in
front of blk_stat_free_callback().

Fixes: 015466fc61f4 ("block: fix null-pointer dereference in ioc_pd_init")
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
(cherry picked from commit e539db97)
parent 6ef88c97
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -786,14 +786,14 @@ static void blk_release_queue(struct kobject *kobj)

	might_sleep();

	rq_qos_exit(q);

	if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags))
		blk_stat_remove_callback(q, q->poll_cb);
	blk_stat_free_callback(q->poll_cb);

	blk_free_queue_stats(q->stats);

	rq_qos_exit(q);

	blk_exit_queue(q);

	blk_queue_free_zone_bitmaps(q);