Skip to content

Commit 6b08b4e

Browse files
Dan Carpenterrafaeljw
authored andcommitted
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: 26096ae ("powercap/intel_rapl: Fix the energy-pkg event for AMD CPUs") Signed-off-by: Dan Carpenter <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 95f6580 commit 6b08b4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/powercap/intel_rapl_common.c

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

0 commit comments

Comments
 (0)