linux-stable/drivers/powercap
Jacob Pan cb43f81b84 powercap/intel_rapl: fix and tidy up error handling
Commit e1399ba20e ("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: e1399ba20e ("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>
2016-11-29 00:02:29 +01:00
..
intel_rapl.c powercap/intel_rapl: fix and tidy up error handling 2016-11-29 00:02:29 +01:00
Kconfig powercap / RAPL: fix build dependency on iosf_mbi 2014-11-12 21:09:19 +01:00
Makefile
powercap_sys.c powercap: constify powercap_zone_ops and powercap_zone_constraint_ops structures 2016-01-02 00:29:35 +01:00