diff options
Diffstat (limited to 'drivers/acpi/cppc_acpi.c')
| -rw-r--r-- | drivers/acpi/cppc_acpi.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 8adac69dba3d..2e981732805b 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c | |||
| @@ -299,8 +299,10 @@ int acpi_get_psd_map(struct cpudata **all_cpu_data) | |||
| 299 | continue; | 299 | continue; |
| 300 | 300 | ||
| 301 | cpc_ptr = per_cpu(cpc_desc_ptr, i); | 301 | cpc_ptr = per_cpu(cpc_desc_ptr, i); |
| 302 | if (!cpc_ptr) | 302 | if (!cpc_ptr) { |
| 303 | continue; | 303 | retval = -EFAULT; |
| 304 | goto err_ret; | ||
| 305 | } | ||
| 304 | 306 | ||
| 305 | pdomain = &(cpc_ptr->domain_info); | 307 | pdomain = &(cpc_ptr->domain_info); |
| 306 | cpumask_set_cpu(i, pr->shared_cpu_map); | 308 | cpumask_set_cpu(i, pr->shared_cpu_map); |
| @@ -322,8 +324,10 @@ int acpi_get_psd_map(struct cpudata **all_cpu_data) | |||
| 322 | continue; | 324 | continue; |
| 323 | 325 | ||
| 324 | match_cpc_ptr = per_cpu(cpc_desc_ptr, j); | 326 | match_cpc_ptr = per_cpu(cpc_desc_ptr, j); |
| 325 | if (!match_cpc_ptr) | 327 | if (!match_cpc_ptr) { |
| 326 | continue; | 328 | retval = -EFAULT; |
| 329 | goto err_ret; | ||
| 330 | } | ||
| 327 | 331 | ||
| 328 | match_pdomain = &(match_cpc_ptr->domain_info); | 332 | match_pdomain = &(match_cpc_ptr->domain_info); |
| 329 | if (match_pdomain->domain != pdomain->domain) | 333 | if (match_pdomain->domain != pdomain->domain) |
| @@ -353,8 +357,10 @@ int acpi_get_psd_map(struct cpudata **all_cpu_data) | |||
| 353 | continue; | 357 | continue; |
| 354 | 358 | ||
| 355 | match_cpc_ptr = per_cpu(cpc_desc_ptr, j); | 359 | match_cpc_ptr = per_cpu(cpc_desc_ptr, j); |
| 356 | if (!match_cpc_ptr) | 360 | if (!match_cpc_ptr) { |
| 357 | continue; | 361 | retval = -EFAULT; |
| 362 | goto err_ret; | ||
| 363 | } | ||
| 358 | 364 | ||
| 359 | match_pdomain = &(match_cpc_ptr->domain_info); | 365 | match_pdomain = &(match_cpc_ptr->domain_info); |
| 360 | if (match_pdomain->domain != pdomain->domain) | 366 | if (match_pdomain->domain != pdomain->domain) |
| @@ -595,9 +601,6 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) | |||
| 595 | /* Store CPU Logical ID */ | 601 | /* Store CPU Logical ID */ |
| 596 | cpc_ptr->cpu_id = pr->id; | 602 | cpc_ptr->cpu_id = pr->id; |
| 597 | 603 | ||
| 598 | /* Plug it into this CPUs CPC descriptor. */ | ||
| 599 | per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr; | ||
| 600 | |||
| 601 | /* Parse PSD data for this CPU */ | 604 | /* Parse PSD data for this CPU */ |
| 602 | ret = acpi_get_psd(cpc_ptr, handle); | 605 | ret = acpi_get_psd(cpc_ptr, handle); |
| 603 | if (ret) | 606 | if (ret) |
| @@ -610,6 +613,9 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) | |||
| 610 | goto out_free; | 613 | goto out_free; |
| 611 | } | 614 | } |
| 612 | 615 | ||
| 616 | /* Plug PSD data into this CPUs CPC descriptor. */ | ||
| 617 | per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr; | ||
| 618 | |||
| 613 | /* Everything looks okay */ | 619 | /* Everything looks okay */ |
| 614 | pr_debug("Parsed CPC struct for CPU: %d\n", pr->id); | 620 | pr_debug("Parsed CPC struct for CPU: %d\n", pr->id); |
| 615 | 621 | ||
