diff --git a/kernel/sched.c b/kernel/sched.c
index 7e1f705970263fc22166b992eb54d06c18d45b71..c10c4c7704d8064533b5fa1b3662faa678ef0ed2 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3636,7 +3636,7 @@ void cpu_attach_domain(struct sched_domain *sd, int cpu)
 
 	spin_lock_irqsave(&rq->lock, flags);
 
-	if (cpu == smp_processor_id() || cpu_is_offline(cpu)) {
+	if (cpu == smp_processor_id() || !cpu_online(cpu)) {
 		rq->sd = sd;
 	} else {
 		init_completion(&req.done);