Merge pull request #2755 from Guozhanxin/sensor_fix

[sensor] Fixed error with mutex_lock take and release not matching.
This commit is contained in:
Bernard Xiong 2019-06-06 21:30:45 +08:00 committed by GitHub
commit c8f0ae3f11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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;
}