diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-07-28 13:25:03 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-07-28 13:25:03 -0400 |
| commit | 3213afb8bf5cf8d8c68a2c2376bf1dda52afae5d (patch) | |
| tree | 980a08df3d17a6d3c6176d86d938b4f3dbcd6eef | |
| parent | d58069265c9d15c04c9e3832cd1d9dffe9d4d5f6 (diff) | |
Revert "Input: zforce - don't overwrite the stack"
This reverts commit 7d01cd261c76f95913c81554a751968a1d282d3a 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.
| -rw-r--r-- | drivers/input/touchscreen/zforce_ts.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c index 80285c71786e..f58a196521a9 100644 --- a/drivers/input/touchscreen/zforce_ts.c +++ b/drivers/input/touchscreen/zforce_ts.c | |||
| @@ -429,7 +429,7 @@ static int zforce_read_packet(struct zforce_ts *ts, u8 *buf) | |||
| 429 | goto unlock; | 429 | goto unlock; |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | if (buf[PAYLOAD_LENGTH] == 0 || buf[PAYLOAD_LENGTH] > FRAME_MAXSIZE) { | 432 | if (buf[PAYLOAD_LENGTH] == 0) { |
| 433 | dev_err(&client->dev, "invalid payload length: %d\n", | 433 | dev_err(&client->dev, "invalid payload length: %d\n", |
| 434 | buf[PAYLOAD_LENGTH]); | 434 | buf[PAYLOAD_LENGTH]); |
| 435 | ret = -EIO; | 435 | ret = -EIO; |
