From: Fil Dunsky Keep the signed return value of i2c_smbus_read_byte_data and reject errors before testing CONVIRQ. Truncating an errno to u8 can set the conversion-pending bit; for example, -EIO becomes 0xfb and causes a channel read and potentially a touch report after the failed status read. Fixes: 43df039c6d92 ("Input: sx8654 - add sx8650 support") Cc: stable@vger.kernel.org Signed-off-by: Fil Dunsky --- drivers/input/touchscreen/sx8654.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c index 13dd80a8e..1ae00cc2a 100644 --- a/drivers/input/touchscreen/sx8654.c +++ b/drivers/input/touchscreen/sx8654.c @@ -130,8 +130,7 @@ static irqreturn_t sx8650_irq(int irq, void *handle) { struct sx8654 *ts = handle; struct device *dev = &ts->client->dev; - int len, i; - u8 stat; + int len, i, stat; u16 x, y; u16 ch; u16 chdata; @@ -142,6 +141,9 @@ static irqreturn_t sx8650_irq(int irq, void *handle) stat = i2c_smbus_read_byte_data(ts->client, CMD_READ_REGISTER | I2C_REG_SX8650_STAT); + if (stat < 0) + return IRQ_HANDLED; + if (!(stat & SX8650_STAT_CONVIRQ)) { dev_dbg(dev, "%s ignore stat [0x%02x]", __func__, stat); return IRQ_HANDLED; -- 2.53.0