forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
powercap/intel_rapl: fix and tidy up error handling
Commit e1399ba ("powercap / RAPL: handle missing MSRs") added contraint_to_pl() function to return index into an array. But it can potentially return -EINVAL if powercap layer sends an out of range constraint ID. This patch adds sanity check. Unnecessary RAPL domain pointer check is removed since it must be initialized before calling rapl_unit_xlate(). Fixes: e1399ba ("powercap / RAPL: handle missing MSRs") Reported-by: Odzioba, Lukasz <[email protected]> Reported-by: Koss, Marcin <[email protected]> Signed-off-by: Jacob Pan <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
- Loading branch information
Showing
1 changed file
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters