Skip to content

Commit

Permalink
Revert "Input: zforce - don't overwrite the stack"
Browse files Browse the repository at this point in the history
This reverts commit 7d01cd2 because
with given FRAME_MAXSIZE of 257 the check will never trigger and it
causes warnings from GCC (with -Wtype-limits). Also the check was
incorrect as it was not accounting for the already read 2 bytes of data
stored in the buffer.
  • Loading branch information
Dmitry Torokhov committed Jul 28, 2015
1 parent d580692 commit 3213afb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/touchscreen/zforce_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static int zforce_read_packet(struct zforce_ts *ts, u8 *buf)
goto unlock;
}

if (buf[PAYLOAD_LENGTH] == 0 || buf[PAYLOAD_LENGTH] > FRAME_MAXSIZE) {
if (buf[PAYLOAD_LENGTH] == 0) {
dev_err(&client->dev, "invalid payload length: %d\n",
buf[PAYLOAD_LENGTH]);
ret = -EIO;
Expand Down

0 comments on commit 3213afb

Please sign in to comment.