Skip to content

Commit 8ade4ff

Browse files
committed
[sensor] Fixed error with mutex_lock take and release not matching.| 修复锁的获取和释放不对应的错误.
1 parent 91c858e commit 8ade4ff

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)