Private
Public Access
2
0

i2c.c: Fix resource leak when I2C_FUNCS ioctl fails

This isn't a true failure condition just assume we have no features and carry
on

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2015-01-20 17:12:57 +00:00
parent 25bd897ec5
commit e3dba949b6

View File

@@ -129,7 +129,7 @@ mraa_i2c_init_raw(unsigned int bus)
if (ioctl(dev->fh, I2C_FUNCS, &dev->funcs) < 0) {
syslog(LOG_CRIT, "i2c: Failed to get I2C_FUNC map from device");
return NULL;
dev->funcs = 0;
}
if (advance_func->i2c_init_post != NULL) {