diff options
author | Jacob Pan <jacob.jun.pan@linux.intel.com> | 2016-11-28 13:53:11 -0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-11-29 00:02:29 +0100 |
commit | cb43f81b8489dcb87555e16c17453f0a9fa690f2 (patch) | |
tree | c2adf0174613051b37795eda564ef537dada9727 /drivers/powercap/Kconfig | |
parent | b4005e9278a4e62819fb16ba4bc3430ca650d0ab (diff) |
powercap/intel_rapl: fix and tidy up error handling
Commit e1399ba20eee ("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: e1399ba20eee ("powercap / RAPL: handle missing MSRs")
Reported-by: Odzioba, Lukasz <lukasz.odzioba@intel.com>
Reported-by: Koss, Marcin <marcin.koss@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/powercap/Kconfig')
0 files changed, 0 insertions, 0 deletions