Thread (19 messages) 19 messages, 6 authors, 2020-09-08

Re: [PATCH 2/5] input: misc: Add IBM Operation Panel driver

From: Wolfram Sang <wsa@kernel.org>
Date: 2020-09-01 06:11:13
Also in: linux-aspeed, linux-devicetree, linux-i2c, lkml

+	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?

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help