unsigned long max_perf, min_perf, des_perf,
                      cap_perf, lowest_nonlinear_perf;
        struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
-       struct amd_cpudata *cpudata = policy->driver_data;
+       struct amd_cpudata *cpudata;
+
+       if (!policy)
+               return;
+
+       cpudata = policy->driver_data;
 
        if (policy->min != cpudata->min_limit_freq || policy->max != cpudata->max_limit_freq)
                amd_pstate_update_min_max_limit(policy);
 static void amd_pstate_update_limits(unsigned int cpu)
 {
        struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
-       struct amd_cpudata *cpudata = policy->driver_data;
+       struct amd_cpudata *cpudata;
        u32 prev_high = 0, cur_high = 0;
        int ret;
        bool highest_perf_changed = false;
 
+       if (!policy)
+               return;
+
+       cpudata = policy->driver_data;
+
        mutex_lock(&amd_pstate_driver_lock);
        if ((!amd_pstate_prefcore) || (!cpudata->hw_prefcore))
                goto free_cpufreq_put;