===================================================================
@@ -388,10 +388,6 @@ static int em_create_perf_table(struct d
em_init_performance(dev, pd, table, nr_states);
- ret = em_compute_costs(dev, table, cb, nr_states, flags);
- if (ret)
- return -EINVAL;
-
return 0;
}
@@ -434,6 +430,10 @@ static int em_create_pd(struct device *d
if (ret)
goto free_pd_table;
+ ret = em_compute_costs(dev, em_table->state, cb, nr_states, flags);
+ if (ret)
+ goto free_pd_table;
+
rcu_assign_pointer(pd->em_table, em_table);
if (_is_cpu_device(dev))