diff mbox

[1/1] cpufreq: exynos5440: Fix potential NULL pointer dereference

Message ID 1379481293-9003-1-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Sachin Kamat Sept. 18, 2013, 5:14 a.m. UTC
If 'dvfs_info' is NULL (due to devm_kzalloc failure) the failure
error message would try to dereference it. Use 'pdev' instead.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/cpufreq/exynos5440-cpufreq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Viresh Kumar Sept. 18, 2013, 5:36 a.m. UTC | #1
On 18 September 2013 10:44, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> If 'dvfs_info' is NULL (due to devm_kzalloc failure) the failure
> error message would try to dereference it. Use 'pdev' instead.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/cpufreq/exynos5440-cpufreq.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c
> index d514c15..be5380e 100644
> --- a/drivers/cpufreq/exynos5440-cpufreq.c
> +++ b/drivers/cpufreq/exynos5440-cpufreq.c
> @@ -457,7 +457,7 @@ err_free_table:
>         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;
>  }

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c
index d514c15..be5380e 100644
--- a/drivers/cpufreq/exynos5440-cpufreq.c
+++ b/drivers/cpufreq/exynos5440-cpufreq.c
@@ -457,7 +457,7 @@  err_free_table:
 	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;
 }