mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
powercap: intel_rapl: Change an error pointer to NULL
The rapl_find_package_domain_cpuslocked() function is supposed to
return NULL on error.
This new error patch returns ERR_PTR(-EINVAL) but none of the callers
check for that so it would lead to an Oops.
Fixes: 26096aed25
("powercap/intel_rapl: Fix the energy-pkg event for AMD CPUs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/fa719c6a-8d3b-4cca-9b43-bcd477ff6655@stanley.mountain
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
95f6580352
commit
6b08b4ee5e
@ -2157,7 +2157,7 @@ struct rapl_package *rapl_find_package_domain_cpuslocked(int id, struct rapl_if_
|
||||
topology_physical_package_id(id) : topology_logical_die_id(id);
|
||||
if (uid < 0) {
|
||||
pr_err("topology_logical_(package/die)_id() returned a negative value");
|
||||
return ERR_PTR(-EINVAL);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user