Input: adafruit-seesaw - check i2c_transfer() return value

i2c_transfer() returns the number of messages transferred or a negative
error code. The seesaw register read helper only checks for negative
errors and therefore treats short transfers as successful.

If only the register-address message is transferred, callers consume
data that was not read from the device. This can result in bogus button
or axis events.

Require both messages to be transferred, preserve negative error codes,
and return -EIO for a short transfer.

Fixes: 52c4e5985a73 ("Input: driver for Adafruit Seesaw Gamepad")
Signed-off-by: Siqi Chen <chensiqi@uniontech.com>
Link: https://patch.msgid.link/20261124054344.1067234-1-chensiqi@uniontech.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
diff --git a/drivers/input/joystick/adafruit-seesaw.c b/drivers/input/joystick/adafruit-seesaw.c
index 897e14b..8374381 100644
--- a/drivers/input/joystick/adafruit-seesaw.c
+++ b/drivers/input/joystick/adafruit-seesaw.c
@@ -107,6 +107,8 @@ static int seesaw_register_read(struct i2c_client *client, u16 reg, void *buf,
 			   ARRAY_SIZE(message_buf));
 	if (ret < 0)
 		return ret;
+	if (ret != ARRAY_SIZE(message_buf))
+		return -EIO;
 
 	return 0;
 }