Browse Source

Fixed coverity CID #12530

sbg
Daniel Agar 10 years ago committed by Lorenz Meier
parent
commit
9f32a85409
  1. 4
      src/drivers/hmc5883/hmc5883.cpp

4
src/drivers/hmc5883/hmc5883.cpp

@ -1351,13 +1351,15 @@ start_bus(struct hmc5883_bus_option &bus, enum Rotation rotation) @@ -1351,13 +1351,15 @@ start_bus(struct hmc5883_bus_option &bus, enum Rotation rotation)
}
int fd = open(bus.devpath, O_RDONLY);
if (fd < 0)
if (fd < 0) {
return false;
}
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
close(fd);
errx(1,"Failed to setup poll rate");
}
close(fd);
return true;
}

Loading…
Cancel
Save