From 990d9fb3973cc3d3e211f0b4eebd8e909efd8028 Mon Sep 17 00:00:00 2001 From: Barak Sason Rofman Date: Tue, 3 Dec 2019 12:13:16 +0200 Subject: 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 --- xlators/features/cloudsync/src/cloudsync.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'xlators/features/cloudsync/src/cloudsync.c') 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; } -- cgit