Skip to content

Commit d5f3125

Browse files
Ferruh Yigitgregkh
authored andcommitted
Input: cyttsp - fix memcpy size param
commit d2983cd upstream. memcpy param is wrong because of offset in bl_cmd, this may corrupt the stack which may cause a crash. Tested-by: Ferruh Yigit <fery@cypress.com> on TMA300-DVK Signed-off-by: Ferruh Yigit <fery@cypress.com> Acked-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 15aaf7e commit d5f3125

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/input/touchscreen/cyttsp_core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static int cyttsp_exit_bl_mode(struct cyttsp *ts)
133133
memcpy(bl_cmd, bl_command, sizeof(bl_command));
134134
if (ts->pdata->bl_keys)
135135
memcpy(&bl_cmd[sizeof(bl_command) - CY_NUM_BL_KEYS],
136-
ts->pdata->bl_keys, sizeof(bl_command));
136+
ts->pdata->bl_keys, CY_NUM_BL_KEYS);
137137

138138
error = ttsp_write_block_data(ts, CY_REG_BASE,
139139
sizeof(bl_cmd), bl_cmd);

0 commit comments

Comments
 (0)