Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932748AbbFILdB (ORCPT ); Tue, 9 Jun 2015 07:33:01 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:34817 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752506AbbFILcx (ORCPT ); Tue, 9 Jun 2015 07:32:53 -0400 From: Aleksa Sarai To: tj@kernel.org, lizefan@huawei.com, mingo@redhat.com, peterz@infradead.org Cc: richard@nod.at, fweisbec@gmail.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Aleksa Sarai Subject: [PATCH v14 1/4] cgroup: fix uninitialised iterator in for_each_subsys_which Date: Tue, 9 Jun 2015 21:32:07 +1000 Message-Id: <1433849530-22845-2-git-send-email-cyphar@cyphar.com> X-Mailer: git-send-email 2.4.2 In-Reply-To: <1433849530-22845-1-git-send-email-cyphar@cyphar.com> References: <1433849530-22845-1-git-send-email-cyphar@cyphar.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1038 Lines: 30 Fix the fact that @ssid is uninitialised in the case where CGROUP_SUBSYS_COUNT = 0 by setting ssid to 0. Fixes: cb4a31675270 ("cgroup: use bitmask to filter for_each_subsys") Signed-off-by: Aleksa Sarai --- kernel/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 6d6d3c7..12b580f 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -424,7 +424,7 @@ static int notify_on_release(const struct cgroup *cgrp) */ #define for_each_subsys_which(ss, ssid, ss_maskp) \ if (!CGROUP_SUBSYS_COUNT) /* to avoid spurious gcc warning */ \ - ; \ + (ssid) = 0; \ else \ for_each_set_bit(ssid, ss_maskp, CGROUP_SUBSYS_COUNT) \ if (((ss) = cgroup_subsys[ssid]) && false) \ -- 2.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/