drivers/bch: Fix 'Missing Unlock' in bchdev_driver.c
Jira: PDFW15IS-265 Coverity-ID: 10597 Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
a862b653bd
commit
810f9b516c
@ -113,6 +113,7 @@ static int bch_open(FAR struct file *filep)
|
|||||||
{
|
{
|
||||||
FAR struct inode *inode = filep->f_inode;
|
FAR struct inode *inode = filep->f_inode;
|
||||||
FAR struct bchlib_s *bch;
|
FAR struct bchlib_s *bch;
|
||||||
|
int ret = OK;
|
||||||
|
|
||||||
DEBUGASSERT(inode && inode->i_private);
|
DEBUGASSERT(inode && inode->i_private);
|
||||||
bch = (FAR struct bchlib_s *)inode->i_private;
|
bch = (FAR struct bchlib_s *)inode->i_private;
|
||||||
@ -122,7 +123,7 @@ static int bch_open(FAR struct file *filep)
|
|||||||
bchlib_semtake(bch);
|
bchlib_semtake(bch);
|
||||||
if (bch->refs == MAX_OPENCNT)
|
if (bch->refs == MAX_OPENCNT)
|
||||||
{
|
{
|
||||||
return -EMFILE;
|
ret = -EMFILE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -130,7 +131,7 @@ static int bch_open(FAR struct file *filep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bchlib_semgive(bch);
|
bchlib_semgive(bch);
|
||||||
return OK;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user