From 1004f959ca3b3697f2759f929ca4c11537f6c488 Mon Sep 17 00:00:00 2001 From: yatipadia Date: Fri, 4 Oct 2019 18:21:42 +0530 Subject: POSIX/xlators: Unused and unchecked value coverity issue This patch addresses CID-1274094 and CID-1382354 Problem(1): "ret" was assigned a value which was never used, it was overwritten by 0 and hence has no use. Problem(2): function was called without checking the return value. Solution(1): Removed the assignment and just called the function whose value was being written in ret. Solution(2): There was no need to check for the return value as at the end 0 is returned, so typecasted the return value as void. Change-Id: Iefd0e9000c466ef2428c754c31370263bf1ca0d0 updates: bz#789278 --- xlators/storage/posix/src/posix-helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/storage/posix') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index d416947403a..8cb66a7f9f1 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -364,7 +364,7 @@ _posix_get_marker_all_contributions(posix_xattr_filler_t *filler) while (remaining_size > 0) { len = snprintf(key, sizeof(key), "%s", list + list_offset); if (fnmatch(marker_contri_key, key, 0) == 0) { - ret = _posix_xattr_get_set_from_backend(filler, key); + (void)_posix_xattr_get_set_from_backend(filler, key); } remaining_size -= (len + 1); list_offset += (len + 1); @@ -1784,7 +1784,7 @@ posix_gfid_heal(xlator_t *this, const char *path, loc_t *loc, dict_t *xattr_req) } } - posix_gfid_set(this, path, loc, xattr_req, GF_CLIENT_PID_MAX, &ret); + (void)posix_gfid_set(this, path, loc, xattr_req, GF_CLIENT_PID_MAX, &ret); return 0; } -- cgit