From 6472b43cfdb7454f1c1f1faf57ff13643d62fad7 Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Tue, 9 Oct 2018 19:40:31 +0530 Subject: 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 --- xlators/features/locks/src/posix.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/features/locks/src/posix.c') diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 49ff36f0135..3528e686a96 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -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 -- cgit