]>
git.ipfire.org Git - thirdparty/libcgroup.git/commit
cgxget: Fix clang warning
Fix the following clang warning by explicitily initializing disk_cg to
NULL.
tools/cgxget.c:903:6: warning: variable 'disk_cg' is used uninitialized
whenever 'if' condition is true [-Wsometimes-uninitialized]
903 | if (!cg || !(*cg)) {
| ^~~~~~~~~~~~~
tools/cgxget.c:940:6: note: uninitialized use occurs here
940 | if (disk_cg)
| ^~~~~~~
tools/cgxget.c:903:2: note: remove the 'if' if its condition is always
false
903 | if (!cg || !(*cg)) {
| ^~~~~~~~~~~~~~~~~~~~
904 | ret = ECGINVAL;
| ~~~~~~~~~~~~~~~
905 | goto out;
| ~~~~~~~~~
906 | }
| ~
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>