mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 09:04:21 +08:00
Revert "Input: zforce - don't overwrite the stack"
This reverts commit 7d01cd261c
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.
This commit is contained in:
parent
d58069265c
commit
3213afb8bf
@ -429,7 +429,7 @@ static int zforce_read_packet(struct zforce_ts *ts, u8 *buf)
|
|||||||
goto unlock;
|
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",
|
dev_err(&client->dev, "invalid payload length: %d\n",
|
||||||
buf[PAYLOAD_LENGTH]);
|
buf[PAYLOAD_LENGTH]);
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
|
Loading…
Reference in New Issue
Block a user