Skip to content

Commit d7f3fcc

Browse files
committed
Add error check for _sync() in I2CEEBlockDevice::read
1 parent 97c00f1 commit d7f3fcc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ int I2CEEBlockDevice::read(void *buffer, bd_addr_t addr, bd_size_t size)
6868

6969
_i2c->stop();
7070

71-
_sync();
71+
auto err = _sync();
72+
if (err) {
73+
return err;
74+
}
7275

7376
if (0 != _i2c->read(_i2c_addr, static_cast<char *>(buffer), size)) {
7477
return BD_ERROR_DEVICE_ERROR;

0 commit comments

Comments
 (0)