]> 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 17:00:38 +0000 (11:00 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 20 Jul 2022 17:00:41 +0000 (11:00 -0600)
commit381834ed04ff4a6e7ad16aa84df5ee6581fae815
tree8e48cf2569483ae8fafbe4565f151a6286d36538
parentae96348967a82fcd18527cb150ac6f7235fb0777
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>
(cherry picked from commit f2f107c8b3ef0f699c0a3f77aeebbcbeb4f1b8b1)
src/tools/cgsnapshot.c