Message ID | 20231215063452.3097535-1-guoqi0226@163.com |
---|---|
State | New |
Headers | show |
Series | i2c: smbus: Fixed uninitialized variable msgbuf in i2c_smbus_xfer_emulated | expand |
diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c index e3b96fc..f7b0980d 100644 --- a/drivers/i2c/i2c-core-smbus.c +++ b/drivers/i2c/i2c-core-smbus.c @@ -351,6 +351,8 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, bool wants_pec = ((flags & I2C_CLIENT_PEC) && size != I2C_SMBUS_QUICK && size != I2C_SMBUS_I2C_BLOCK_DATA); + memset(msgbuf0, 0, sizeof(msgbuf0)); + memset(msgbuf1, 0, sizeof(msgbuf1)); msgbuf0[0] = command; switch (size) { case I2C_SMBUS_QUICK: