Set a 0xff value for i2c reads of an mctp-i2c device. Otherwise reads will return "val" from the i2c bus driver. For i2c-aspeed and i2c-npcm7xx that is a stack uninitialised u8. Tested with "i2ctransfer -y 1 r10@0x34" where 0x34 is a mctp-i2c instance, now it returns all 0xff. Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver") Signed-off-by: Matt Johnston --- I'm targeting net-next since this depends on the just-committed fix from Jian Zhang ae4744e173fa ("net: mctp-i2c: fix duplicate reception of old data") That patch and this one should both be applied to stable - will that happen automatically with "Fixes:"? Thanks, Matt --- drivers/net/mctp/mctp-i2c.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mctp/mctp-i2c.c b/drivers/net/mctp/mctp-i2c.c index ecda1cc36391ce50a6b28e6a9e13c3b344f8f993..8043b57bdf25095b3b4e6bacd3abbc6f8952acfe 100644 --- a/drivers/net/mctp/mctp-i2c.c +++ b/drivers/net/mctp/mctp-i2c.c @@ -243,7 +243,10 @@ static int mctp_i2c_slave_cb(struct i2c_client *client, switch (event) { case I2C_SLAVE_READ_REQUESTED: + case I2C_SLAVE_READ_PROCESSED: + /* MCTP I2C transport only uses writes */ midev->rx_pos = 0; + *val = 0xff; break; case I2C_SLAVE_WRITE_RECEIVED: if (midev->rx_pos < MCTP_I2C_BUFSZ) { --- base-commit: f10c325a345fef0a688a2bcdfab1540d1c924148 change-id: 20260113-mctp-read-fix-e191357ad049 prerequisite-message-id: <20260108101829.1140448-1-zhangjian.3032@bytedance.com> prerequisite-patch-id: 0765450364f2e9f65f6f3940d4a45598763aae8c Best regards, -- Matt Johnston