mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 11:26:12 +08:00
drivers/timers/capture: Fix mutual exclusion lock
This commit is contained in:
@@ -115,7 +115,7 @@ static int cap_open(FAR struct file *filep)
|
|||||||
|
|
||||||
/* Get exclusive access to the device structures */
|
/* Get exclusive access to the device structures */
|
||||||
|
|
||||||
ret = nxmutex_lock(&priv->lock);
|
ret = nxmutex_lock(&upper->lock);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto errout;
|
goto errout;
|
||||||
@@ -158,7 +158,7 @@ static int cap_open(FAR struct file *filep)
|
|||||||
ret = OK;
|
ret = OK;
|
||||||
|
|
||||||
errout_with_lock:
|
errout_with_lock:
|
||||||
nxmutex_unlock(&priv->lock);
|
nxmutex_unlock(&upper->lock);
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
return ret;
|
return ret;
|
||||||
@@ -180,7 +180,7 @@ static int cap_close(FAR struct file *filep)
|
|||||||
|
|
||||||
/* Get exclusive access to the device structures */
|
/* Get exclusive access to the device structures */
|
||||||
|
|
||||||
ret = nxmutex_lock(&priv->lock);
|
ret = nxmutex_lock(&upper->lock);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto errout;
|
goto errout;
|
||||||
@@ -209,7 +209,7 @@ static int cap_close(FAR struct file *filep)
|
|||||||
lower->ops->stop(lower);
|
lower->ops->stop(lower);
|
||||||
}
|
}
|
||||||
|
|
||||||
nxmutex_unlock(&priv->lock);
|
nxmutex_unlock(&upper->lock);
|
||||||
ret = OK;
|
ret = OK;
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
@@ -274,7 +274,7 @@ static int cap_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
|
|
||||||
/* Get exclusive access to the device structures */
|
/* Get exclusive access to the device structures */
|
||||||
|
|
||||||
ret = nxmutex_lock(&priv->lock);
|
ret = nxmutex_lock(&upper->lock);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
return ret;
|
return ret;
|
||||||
@@ -319,7 +319,7 @@ static int cap_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nxmutex_unlock(&priv->lock);
|
nxmutex_unlock(&upper->lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user