From 8ade4fff2e9d3d2966a6312314079cbc51a87dcb Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Thu, 6 Jun 2019 16:07:41 +0800 Subject: [PATCH] =?UTF-8?q?[sensor]=20Fixed=20error=20with=20mutex=5Flock?= =?UTF-8?q?=20take=20and=20release=20not=20matching.|=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=94=81=E7=9A=84=E8=8E=B7=E5=8F=96=E5=92=8C=E9=87=8A=E6=94=BE?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=E5=BA=94=E7=9A=84=E9=94=99=E8=AF=AF.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/sensors/sensor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/drivers/sensors/sensor.c b/components/drivers/sensors/sensor.c index 620d3b1d0a..dba20f6555 100644 --- a/components/drivers/sensors/sensor.c +++ b/components/drivers/sensors/sensor.c @@ -195,6 +195,11 @@ static rt_err_t rt_sensor_open(rt_device_t dev, rt_uint16_t oflag) } else { + if (sensor->module) + { + /* release the module mutex */ + rt_mutex_release(sensor->module->lock); + } return -RT_EINVAL; }