On Mon, 2017-08-14 at 22:17 +0200, Hans de Goede wrote: > Although unlikely without locking the smbux_xfer function may miss > the nack flag and further fixes in this patch-set add some more > complex constructions which need protection. > - if (read_write == I2C_SMBUS_READ) { > + ret = 0; > + mutex_lock(&adap->adap_lock); > + if (adap->nack) > + ret = -EIO; > + else if (read_write == I2C_SMBUS_READ) { > ret = regmap_read(adap->regmap, CHT_WC_I2C_RDDATA, > ®); > - if (ret) > - return ret; > - > data->byte = reg; Can this be moved out to keep logic the same (don't dirt data on error)? > } > + mutex_unlock(&adap->adap_lock); > > - return 0; > + return ret; -- Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Intel Finland Oy