[PATCH 2/5] input: misc: Add IBM Operation Panel driver
Wolfram Sang
wsa at kernel.org
Tue Sep 1 16:11:08 AEST 2020
> + switch (event) {
> + case I2C_SLAVE_STOP:
> + command_size = panel->idx;
> + fallthrough;
> + case I2C_SLAVE_WRITE_REQUESTED:
> + panel->idx = 0;
> + break;
> + case I2C_SLAVE_WRITE_RECEIVED:
> + if (panel->idx < sizeof(panel->command))
> + panel->command[panel->idx++] = *val;
> + else
> + dev_dbg(&panel->input->dev, "command truncated\n");
Just double checking: Do you really want to process truncated commands?
Since you detect the state here, you could also choose to reject such
commands?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20200901/2d5dae3a/attachment.sig>
More information about the Linux-aspeed
mailing list