Skip to content

Commit c8f0ae3

Browse files
authored
Merge pull request #2755 from Guozhanxin/sensor_fix
[sensor] Fixed error with mutex_lock take and release not matching.
2 parents 6cc7c02 + 8ade4ff commit c8f0ae3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/drivers/sensors/sensor.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ static rt_err_t rt_sensor_open(rt_device_t dev, rt_uint16_t oflag)
195195
}
196196
else
197197
{
198+
if (sensor->module)
199+
{
200+
/* release the module mutex */
201+
rt_mutex_release(sensor->module->lock);
202+
}
198203
return -RT_EINVAL;
199204
}
200205

0 commit comments

Comments
 (0)