]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
wrapper: cgroup_add_all_controllers(): fix variable typo release-3.0
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Sun, 23 Apr 2023 11:35:05 +0000 (17:05 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 24 Apr 2023 21:57:31 +0000 (15:57 -0600)
Coverity reported uninitialized value:

CID 313909 (#1 of 1): Uninitialized scalar variable (UNINIT)8.
uninit_use_in_call: Using uninitialized value *info.name as argument to
%s when calling fprintf.

In cgroup_add_all_controllers(), fix the wrong variable name in the
error message, while parsing the controller name.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit c0a166f6a217e7cd82aad125e41b352ed6b2fa47)

src/wrapper.c

index 7301ab8664d93e754941880acccd6dcbb4040963..e01a0c9df7e07d957b613b0910778406ce19c0ef 100644 (file)
@@ -170,7 +170,7 @@ int cgroup_add_all_controllers(struct cgroup *cgroup)
                        cgc = cgroup_add_controller(cgroup, controller);
                        if (!cgc) {
                                ret = ECGINVAL;
-                               fprintf(stderr, "controller %s can't be added\n", info.name);
+                               fprintf(stderr, "controller %s can't be added\n", controller);
                                goto end;
                        }
                } while ((controller = strtok_r(NULL, " ", &stok_buff)));