locks : fix coverity issue

This patch fixes CID 1356544 and 1356539.
Both are of type NULL_RETURNS.

Change-Id: I2ef7c3ff9929c4d85b79fff00e835ebee3ff3ce0
updates: bz#789278
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
This commit is contained in:
Sunny Kumar 2018-10-09 19:40:31 +05:30 committed by Amar Tumballi
parent 0f2113cb0c
commit 6472b43cfd
2 changed files with 8 additions and 0 deletions

View File

@ -363,6 +363,8 @@ pl_update_refkeeper(xlator_t *this, inode_t *inode)
int need_ref = 0;
pl_inode = pl_inode_get(this, inode);
if (!pl_inode)
return;
pthread_mutex_lock(&pl_inode->mutex);
{

View File

@ -1703,6 +1703,12 @@ pl_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
op_ret = 0, op_errno = 0;
pl_inode = pl_inode_get(this, fd->inode);
if (!pl_inode) {
gf_msg(this->name, GF_LOG_ERROR, 0, ENOMEM, "Could not get inode");
op_ret = -1;
op_errno = ENOMEM;
goto unwind;
}
/* As per design, under forced and file-based mandatory locking modes
* it doesn't matter whether inodes's lock list contain advisory or