diff options
author | Andrew Duggan <aduggan@synaptics.com> | 2016-11-08 16:46:20 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-11-08 17:12:06 -0800 |
commit | 6d0dbeae71f074c67b081eae45cd58fa39dfda2e (patch) | |
tree | 4ab16cc8a6cc37d0e9584dfe5ba764a88dabd1f8 /drivers/input/rmi4/rmi_f30.c | |
parent | 3aeed5b573f97b4525841cc07c1e948227af389f (diff) | |
download | op-kernel-dev-6d0dbeae71f074c67b081eae45cd58fa39dfda2e.zip op-kernel-dev-6d0dbeae71f074c67b081eae45cd58fa39dfda2e.tar.gz |
Input: synaptics-rmi4 - handle incomplete input data
Commit 5b65c2a02966 ("HID: rmi: check sanity of the incoming report") added
support for handling incomplete HID reports do to the input data being
corrupted in transit. This patch reimplements this functionality in the
function drivers so they can handle getting less valid data then they
expect.
Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/rmi4/rmi_f30.c')
-rw-r--r-- | drivers/input/rmi4/rmi_f30.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/input/rmi4/rmi_f30.c b/drivers/input/rmi4/rmi_f30.c index 760aff1..485907f 100644 --- a/drivers/input/rmi4/rmi_f30.c +++ b/drivers/input/rmi4/rmi_f30.c @@ -110,6 +110,10 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) /* Read the gpi led data. */ if (rmi_dev->xport->attn_data) { + if (rmi_dev->xport->attn_size < f30->register_count) { + dev_warn(&fn->dev, "F30 interrupted, but data is missing\n"); + return 0; + } memcpy(f30->data_regs, rmi_dev->xport->attn_data, f30->register_count); rmi_dev->xport->attn_data += f30->register_count; |