diff options
Diffstat (limited to 'block/bfq-sched.c')
-rw-r--r-- | block/bfq-sched.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/block/bfq-sched.c b/block/bfq-sched.c index 9328a1f09..a64fec119 100644 --- a/block/bfq-sched.c +++ b/block/bfq-sched.c @@ -839,13 +839,16 @@ static void bfq_activate_entity(struct bfq_entity *entity) static int __bfq_deactivate_entity(struct bfq_entity *entity, int requeue) { struct bfq_sched_data *sd = entity->sched_data; - struct bfq_service_tree *st = bfq_entity_service_tree(entity); - int was_in_service = entity == sd->in_service_entity; + struct bfq_service_tree *st; + int was_in_service; int ret = 0; - if (!entity->on_st) + if (sd == NULL || !entity->on_st) /* never activated, or inactive */ return 0; + st = bfq_entity_service_tree(entity); + was_in_service = entity == sd->in_service_entity; + BUG_ON(was_in_service && entity->tree); if (was_in_service) { |