diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2024-08-23 14:51:36 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-08-23 15:45:17 +0200 |
commit | 6b08b4ee5e60d8789aeb87250f718ef14bebb90e (patch) | |
tree | 5e6e2e1be5020353e07948375accd319f8c485cb /drivers/powercap | |
parent | powercap: intel_rapl: Fix off by one in get_rpi() (diff) | |
download | linux-6b08b4ee5e60d8789aeb87250f718ef14bebb90e.tar.xz linux-6b08b4ee5e60d8789aeb87250f718ef14bebb90e.zip |
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: 26096aed255f ("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>
Diffstat (limited to 'drivers/powercap')
-rw-r--r-- | drivers/powercap/intel_rapl_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index a63a4f04063e..5e793b80fd6b 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -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 |