From: Anton Khirnov Date: Thu, 31 Jul 2014 09:50:34 +0000 (+0200) Subject: cgroup_config_create_template_group: fix inverted error check. X-Git-Tag: v0.42.rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=021c3b0e90679cc7abdb74faeec04d92a1e3a099;p=thirdparty%2Flibcgroup.git cgroup_config_create_template_group: fix inverted error check. 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 Acked-by: Dhaval Giani --- diff --git a/src/config.c b/src/config.c index a576001f..090bea56 100644 --- a/src/config.c +++ b/src/config.c @@ -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);