diff --git a/drivers/bmx280/bmx280.c b/drivers/bmx280/bmx280.c index 568fcfe64a..d662dcbf12 100644 --- a/drivers/bmx280/bmx280.c +++ b/drivers/bmx280/bmx280.c @@ -255,6 +255,7 @@ int bmx280_init(bmx280_t *dev, const bmx280_params_t *params) /* test the connection to the device by reading and verifying its chip ID */ if (_read_reg(dev, BMX280_CHIP_ID_REG, ®) != BMX280_OK) { DEBUG("[bmx280] error: unable to read chip ID from device\n"); + _release(dev); return BMX280_ERR_NODEV; } if (reg != BMX280_CHIP_ID_VAL) {