]> git.baikalelectronics.ru Git - kernel.git/commit
mfd: cros-ec: copy the whole event in get_next_event_xfer
authorEmil Karlson <jekarlson@gmail.com>
Wed, 3 Oct 2018 18:43:18 +0000 (21:43 +0300)
committerBenson Leung <bleung@chromium.org>
Wed, 10 Oct 2018 03:57:30 +0000 (20:57 -0700)
commit6145a382bce70f6e41c5469362559fc6b1a8b201
tree18e21d847b5f4c1de71897149fe94b5b7f2cde5c
parentcc57feb3b8b4dd2db99836ab928838821c89c4fc
mfd: cros-ec: copy the whole event in get_next_event_xfer

Commit ebbdcd9f47363d08f49c679e1eddb136683fd290 caused cros-ec keyboard events
be truncated on many chromebooks so that Left and Right keys on Column 12 were
always 0. Use ret as memcpy len to fix this.

The old code was using ec_dev->event_size, which is the event payload/data size
excluding event_type header, for the length of the memcpy operation. Use ret
as memcpy length to avoid the off by one and copy the whole msg->data.

Fixes: ebbdcd9f4736 ("mfd: cros-ec: Increase maximum mkbp event size")
Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Emil Karlson <jekarlson@gmail.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
drivers/platform/chrome/cros_ec_proto.c