Skip to content

Commit

Permalink
Merge branch 'pm-cpufreq-fixes'
Browse files Browse the repository at this point in the history
* pm-cpufreq-fixes:
  cpufreq: exynos5440: Fix potential NULL pointer dereference
  cpufreq: check cpufreq driver is valid and cpufreq isn't disabled in cpufreq_get()
  acpi-cpufreq: skip loading acpi_cpufreq after intel_pstate
  • Loading branch information
Rafael J. Wysocki committed Sep 27, 2013
2 parents d93faa4 + 116decb commit dcc7bc3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drivers/cpufreq/acpi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,10 @@ static int __init acpi_cpufreq_init(void)
{
int ret;

/* don't keep reloading if cpufreq_driver exists */
if (cpufreq_get_current_driver())
return 0;

if (acpi_disabled)
return 0;

Expand Down
3 changes: 3 additions & 0 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,9 @@ unsigned int cpufreq_get(unsigned int cpu)
{
unsigned int ret_freq = 0;

if (cpufreq_disabled() || !cpufreq_driver)
return -ENOENT;

if (!down_read_trylock(&cpufreq_rwsem))
return 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/cpufreq/exynos5440-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table);
err_put_node:
of_node_put(np);
dev_err(dvfs_info->dev, "%s: failed initialization\n", __func__);
dev_err(&pdev->dev, "%s: failed initialization\n", __func__);
return ret;
}

Expand Down

0 comments on commit dcc7bc3

Please sign in to comment.