Check bfqq->dispatched for each BFQ queue instead of checking it for an invalid bfqq pointer. Fixes: 3e49c1e4a615 ("block: BFQ: Add several invariant checks") Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- block/bfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index c5727afad159..09bbbcf9e049 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5405,6 +5405,7 @@ void bfq_put_queue(struct bfq_queue *bfqq) WARN_ON_ONCE(!list_empty(&bfqq->fifo)); WARN_ON_ONCE(!RB_EMPTY_ROOT(&bfqq->sort_list)); + WARN_ON_ONCE(bfqq->dispatched); kmem_cache_free(bfq_pool, bfqq); bfqg_and_blkg_put(bfqg); @@ -7150,7 +7151,6 @@ static void bfq_exit_queue(struct elevator_queue *e) for (actuator = 0; actuator < bfqd->num_actuators; actuator++) WARN_ON_ONCE(bfqd->rq_in_driver[actuator]); WARN_ON_ONCE(bfqd->tot_rq_in_driver); - WARN_ON_ONCE(bfqq->dispatched); hrtimer_cancel(&bfqd->idle_slice_timer);