From: John Iliopoulos Unlike amd_start_sensor_v2() and amd_stop_sensor_v2(), amd_stop_all_sensor_v2() does not zero-initialize cmd_base.ul before populating fields of cmd_base.cmd_v2. As a result, the rsvd1, length, and mem_type bitfields contain uninitialized stack data when written to AMD_C2P_MSG0. Initialize cmd_base.ul to 0 before setting the command fields. Fixes: f264481ad614 ("HID: amd_sfh: Extend driver capabilities for multi-generation support") Cc: stable@vger.kernel.org Signed-off-by: John Iliopoulos --- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index f48a096a6d2b..f70669bb403e 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -95,6 +95,7 @@ static void amd_stop_all_sensor_v2(struct amd_mp2_dev *privdata) { union sfh_cmd_base cmd_base; + cmd_base.ul = 0; cmd_base.cmd_v2.cmd_id = STOP_ALL_SENSORS; cmd_base.cmd_v2.intr_disable = intr_disable; cmd_base.cmd_v2.period = 0; -- 2.56.1