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: Li Nan linan122@huawei.com --- block/blk-sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 8012a7e51788..92dc765ef124 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -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);