From 021c3b0e90679cc7abdb74faeec04d92a1e3a099 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 31 Jul 2014 11:50:34 +0200 Subject: [PATCH] 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 --- src/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.2