1
0
Fork 0
remarkable-linux/drivers/powercap
Jacob Pan aa3ee06a2a powercap/intel_rapl: fix and tidy up error handling
commit cb43f81b84 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19 20:18:07 +01:00
..
Kconfig powercap / RAPL: fix build dependency on iosf_mbi 2014-11-12 21:09:19 +01:00
Makefile PowerCap: Introduce Intel RAPL power capping driver 2013-10-18 13:29:52 +02:00
intel_rapl.c powercap/intel_rapl: fix and tidy up error handling 2017-01-19 20:18:07 +01:00
powercap_sys.c powercap: constify powercap_zone_ops and powercap_zone_constraint_ops structures 2016-01-02 00:29:35 +01:00