]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tools/cgsnapshot: add ret value fix in parse_controllers()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 20 Jul 2022 16:56:05 +0000 (10:56 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 20 Jul 2022 16:56:10 +0000 (10:56 -0600)
commitf2f107c8b3ef0f699c0a3f77aeebbcbeb4f1b8b1
tree0a9e4e8a05a15289b668b061a491274d626ab7fc
parentc46591c5cf0d85b551668d98b33c86a68853b3d1
tools/cgsnapshot: add ret value fix in parse_controllers()

Fix the unused ret value warning, reported by Coverity:

CID 258275 (#1 of 1): Unused value (UNUSED_VALUE)returned_value:
Assigning value from display_controller_data(controllers, program_name)
to ret here, but that stored value is overwritten before it can be used.

The parse_controllers(), doesn't check for errors in the value returned
by display_controller_data(). The return value might very well contain
an error, that might go unnoticed. Fix it by adding a check for the
return value.

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