From: Dmitry Torokhov Date: Tue, 28 Jul 2015 17:25:03 +0000 (-0700) Subject: Revert "Input: zforce - don't overwrite the stack" X-Git-Tag: v4.9.8~2718^2~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3213afb8bf5cf8d8c68a2c2376bf1dda52afae5d;p=platform%2Fkernel%2Flinux-rpi3.git 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. --- diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c index 80285c7..f58a196 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) 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;