]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tools/cgxset: fix unused value in main
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 7 Jul 2023 05:15:15 +0000 (10:45 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Fri, 7 Jul 2023 15:48:48 +0000 (09:48 -0600)
commitaff4a21b8f38a6602b5986740c1301f5835b8f9c
tree0a1b39b3287efda020223e1952465ec7e274f3e2
parent9a12c1546b7b28ef5c4b0a03b580ac0ac32f019a
tools/cgxset: fix unused value in main

Fix unused value, reported by the Coverity tool:

CID 320876 (#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/cgxset.c