drivers/regulator_rpmsg: destroy nxsem properly
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
07604b3220
commit
dff81756cf
@ -495,18 +495,17 @@ static int regulator_rpmsg_sendrecv(FAR struct rpmsg_endpoint *ept,
|
|||||||
msg->cookie = (uintptr_t)&cookie;
|
msg->cookie = (uintptr_t)&cookie;
|
||||||
|
|
||||||
ret = rpmsg_send_nocopy(ept, msg, len);
|
ret = rpmsg_send_nocopy(ept, msg, len);
|
||||||
if (ret < 0)
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
return ret;
|
ret = nxsem_wait_uninterruptible(&cookie.sem);
|
||||||
|
if (ret >= 0)
|
||||||
|
{
|
||||||
|
ret = cookie.result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = nxsem_wait_uninterruptible(&cookie.sem);
|
nxsem_destroy(&cookie.sem);
|
||||||
if (ret < 0)
|
return ret;
|
||||||
{
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return cookie.result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int regulator_rpmsg_enable(FAR struct regulator_dev_s *rdev)
|
static int regulator_rpmsg_enable(FAR struct regulator_dev_s *rdev)
|
||||||
|
Loading…
Reference in New Issue
Block a user