mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 05:24:12 +08:00
PM / Domains: Fix potential NULL pointer dereference
In the function of_genpd_get_from_provider(), we never check to see if the argument 'genpdspec' is NULL before dereferencing it. Add error checking to handle any NULL pointers. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
beda5fc1ff
commit
41795a8a3c
@ -1702,6 +1702,9 @@ struct generic_pm_domain *of_genpd_get_from_provider(
|
|||||||
struct generic_pm_domain *genpd = ERR_PTR(-ENOENT);
|
struct generic_pm_domain *genpd = ERR_PTR(-ENOENT);
|
||||||
struct of_genpd_provider *provider;
|
struct of_genpd_provider *provider;
|
||||||
|
|
||||||
|
if (!genpdspec)
|
||||||
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
mutex_lock(&of_genpd_mutex);
|
mutex_lock(&of_genpd_mutex);
|
||||||
|
|
||||||
/* Check if we have such a provider in our array */
|
/* Check if we have such a provider in our array */
|
||||||
|
Loading…
Reference in New Issue
Block a user