diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 3c38536bd52c..32629e28a634 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -2305,6 +2305,9 @@ static void cfq_choose_cfqg(struct cfq_data *cfqd) { struct cfq_group *cfqg = cfq_get_next_cfqg(cfqd); + if (!cfqg) + return; + cfqd->serving_group = cfqg; /* Restore the workload type data */