diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c index 333341e80b0e..acfd69ed71a0 100644 --- a/drivers/hid/hid-ft260.c +++ b/drivers/hid/hid-ft260.c @@ -471,7 +471,8 @@ static int ft260_smbus_write(struct ft260_device *dev, u8 addr, u8 cmd, struct ft260_i2c_write_request_report *rep = (struct ft260_i2c_write_request_report *)dev->write_buf; - if (data_len >= sizeof(rep->data)) + if (data_len >= sizeof(rep->data) || + data_len >= sizeof(data)) return -EINVAL; rep->address = addr;