]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
cgroup_config_create_template_group: fix inverted error check.
authorAnton Khirnov <anton@khirnov.net>
Thu, 31 Jul 2014 09:50:34 +0000 (11:50 +0200)
committerAnton Khirnov <anton@khirnov.net>
Thu, 31 Jul 2014 09:50:34 +0000 (11:50 +0200)
The aux_cgroup pointer will be NULL when an error occurs, but the check
is for it being non-NULL.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
src/config.c

index a576001f3b090f0b9e7fc9b855282e9b0ed69f70..090bea56e4a0e3ec4359564868554d26fd8c592e 100644 (file)
@@ -1826,7 +1826,7 @@ int cgroup_config_create_template_group(struct cgroup *cgroup,
                /* no template is present for given name x controller pair
                 * add controller to result cgroup */
                aux_cgroup = cgroup_new_cgroup(cgroup->name);
-               if (aux_cgroup) {
+               if (!aux_cgroup) {
                        ret = ECGINVAL;
                        fprintf(stderr, "cgroup %s can't be created\n",
                                cgroup->name);