]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: CPPC: remove initial assignment of pcc_ss_data
authorColin Ian King <colin.king@canonical.com>
Fri, 8 Dec 2017 23:59:49 +0000 (23:59 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 18 Dec 2017 11:10:37 +0000 (12:10 +0100)
commit6a072b8e73350270b3a1af902b56c89e493a7c83
tree43b5e273a03ffbf8bf9924aba95644cce9fe4a61
parent6d26e52fc39dd1b277640428ccc4ab1abd836cd8
ACPI: CPPC: remove initial assignment of pcc_ss_data

The initialization of pcc_ss_data from pcc_data[pcc_ss_id] before
pcc_ss_id is being range checked could lead to an out-of-bounds array
read.  This very same initialization is also being performed after
the range check on pcc_ss_id, so we can just remove this problematic
and also redundant assignment to fix the issue.

Detected by cppcheck:
warning: Value stored to 'pcc_ss_data' during its initialization is never
read

Fixes: c691b1c5c0a4 (ACPI / CPPC: Make CPPC ACPI driver aware of PCC subspace IDs)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/cppc_acpi.c