From 90152412fe367c715c4b910ed188813cc132ff00 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 17 Feb 2018 19:09:18 +0100 Subject: [PATCH] cgfsng: controller_list_is_dup() Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 6e7f6d622..a14050f11 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -782,10 +782,9 @@ static bool controller_lists_intersect(char **l1, char **l2) return false; } -/* - * For a null-terminated list of controllers @clist, return true if any of - * those controllers is already listed the null-terminated list of - * hierarchies @hlist. Realistically, if one is present, all must be present. +/* For a null-terminated list of controllers @clist, return true if any of those + * controllers is already listed the null-terminated list of hierarchies @hlist. + * Realistically, if one is present, all must be present. */ static bool controller_list_is_dup(struct hierarchy **hlist, char **clist) { @@ -793,11 +792,12 @@ static bool controller_list_is_dup(struct hierarchy **hlist, char **clist) if (!hlist) return false; + for (i = 0; hlist[i]; i++) if (controller_lists_intersect(hlist[i]->controllers, clist)) return true; - return false; + return false; } /* -- 2.47.2