Skip to content

Commit 62a7fdf

Browse files
Dan Carpentergregkh
authored andcommitted
powercap: intel_rapl: Change an error pointer to NULL
commit 6b08b4e upstream. 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: 26096ae ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6c7fc36 commit 62a7fdf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/powercap/intel_rapl_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,7 @@ struct rapl_package *rapl_find_package_domain_cpuslocked(int id, struct rapl_if_
21562156
topology_physical_package_id(id) : topology_logical_die_id(id);
21572157
if (uid < 0) {
21582158
pr_err("topology_logical_(package/die)_id() returned a negative value");
2159-
return ERR_PTR(-EINVAL);
2159+
return NULL;
21602160
}
21612161
}
21622162
else

0 commit comments

Comments
 (0)