mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-03 04:36:51 +07: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 of_genpd_provider *provider;
|
||||
|
||||
if (!genpdspec)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
mutex_lock(&of_genpd_mutex);
|
||||
|
||||
/* Check if we have such a provider in our array */
|
||||
|
Loading…
Reference in New Issue
Block a user