Add error check for _sync() in I2CEEBlockDevice::read

pull/12395/head
Stephan Brunner 2020-02-10 10:31:41 +01:00
parent 97c00f1a22
commit d7f3fcc3d3
No known key found for this signature in database
GPG Key ID: D3CD7237AFB7EF6B
1 changed files with 4 additions and 1 deletions

View File

@ -68,7 +68,10 @@ int I2CEEBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
_i2c->stop();
_sync();
auto err = _sync();
if (err) {
return err;
}
if (0 != _i2c->read(_i2c_addr, static_cast<char *>(buffer), size)) {
return BD_ERROR_DEVICE_ERROR;