]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tools/cgxget: fix unused value in main
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 7 Jul 2023 05:10:27 +0000 (10:40 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 7 Jul 2023 15:46:51 +0000 (09:46 -0600)
commit9a12c1546b7b28ef5c4b0a03b580ac0ac32f019a
tree82d776fa6001cb3eeaffd7f9215f16f84c332d84
parenteec006f5667f586c3cecffdb16c84e08a059d44a
tools/cgxget: fix unused value in main

Fix unused value, reported by the Coverity tool:

CID 320879 (#1 of 1): Unused value (UNUSED_VALUE)assigned_value:
Assigning value 0 to ret here, but that stored value is overwritten
before it can be used.

If the mapping from v1->v2 and vice versa fail, with -i
(ignore-unmappable) set, ret is set to zero and is immediately
over-written, re-arrange the check, and adjust the commentary to avoid
clobbering ret, by taking the error path when -i is unset or else
continuing when set, skipping to set ret to zero.

Suggested-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/tools/cgxget.c