diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 8012a7e51788d0c81174678b632c77e8ef559d80..92dc765ef124513423148b6b0f257beba82fd73d 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);