summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorBarak Sason Rofman <bsasonro@redhat.com>2019-12-03 12:13:16 +0200
committerAmar Tumballi <amarts@gmail.com>2019-12-10 05:08:21 +0000
commit990d9fb3973cc3d3e211f0b4eebd8e909efd8028 (patch)
tree58f0d46965f0c3c6b19b80789ce6397b3747325d /xlators/features
parent400cf809ed24ffb506fed6edd510643be406e3ea (diff)
cloudsync - fixing a coverity issue
A negative value was being passed where it shouldn't have been passed to. Modified code so only a positive value will be passed. fixes: CID#1274209 Change-Id: I5452ddded77664fdd8b5c975af6bc77806a7ffb1 updates: bz#789278
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/cloudsync/src/cloudsync.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/xlators/features/cloudsync/src/cloudsync.c b/xlators/features/cloudsync/src/cloudsync.c
index 05960306302..7f0b9e563b8 100644
--- a/xlators/features/cloudsync/src/cloudsync.c
+++ b/xlators/features/cloudsync/src/cloudsync.c
@@ -388,7 +388,6 @@ int32_t
cs_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
dict_t *xdata)
{
- int op_errno = -1;
cs_local_t *local = NULL;
int ret = 0;
cs_inode_ctx_t *ctx = NULL;
@@ -401,7 +400,6 @@ cs_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
local = cs_local_init(this, frame, loc, NULL, GF_FOP_TRUNCATE);
if (!local) {
gf_msg(this->name, GF_LOG_ERROR, 0, 0, "local init failed");
- op_errno = ENOMEM;
goto err;
}
@@ -427,7 +425,6 @@ cs_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
xdata);
if (!local->stub) {
gf_msg(this->name, GF_LOG_ERROR, 0, 0, "insufficient memory");
- op_errno = ENOMEM;
goto err;
}
@@ -439,14 +436,13 @@ cs_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
local->call_cnt++;
ret = locate_and_execute(frame);
if (ret) {
- op_errno = ENOMEM;
goto err;
}
}
return 0;
err:
- CS_STACK_UNWIND(truncate, frame, -1, op_errno, NULL, NULL, NULL);
+ CS_STACK_UNWIND(truncate, frame, -1, ENOMEM, NULL, NULL, NULL);
return 0;
}