Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp496467lqt; Fri, 19 Apr 2024 02:01:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkQ86aj62wWlfBzaC0Hdl4qYjkVJRFB+/5poft6Wmo042LHLxs9m5aZr5pUp/l3k3vQLMfw6gM9moOmoFsNMReNnY67BsWcicFjwntUQ== X-Google-Smtp-Source: AGHT+IGCGGGycUlVN7MHK7IcvQNgtiQjXu6r6wn/OF3NG/ixewuWmWdDdaOB137sYaAE5y7HVxMG X-Received: by 2002:a50:d51e:0:b0:570:3b4:53ff with SMTP id u30-20020a50d51e000000b0057003b453ffmr1011347edi.6.1713517313802; Fri, 19 Apr 2024 02:01:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713517313; cv=pass; d=google.com; s=arc-20160816; b=0UUQvjwQhPOTOV3v3Ct+mZkON2OJLUSjv3jTydQOeuEAmNfM4KlAB6EbXWves8P0Tl vxLrrUWVWIYML2HwK9tDp79jwqjyIJ/1ydeivyisu+b2Ta5D0I4SLwv7iCEMhahKTVQH 644GDKeypo94WEkIdmR0PwDeYOU+Xr2z6VMcsi04ONM6B0Ng6SL0TswdbWGZ2/Poo22D e4uV3Uw6PAC1he3d7xiqHaBhuh/njdoqZhWNCOFYPNtPbgCiFzICe5gf301BkSFgIaHE NGyhG2ZYj8fikcX+Fhu3fm5tCtoJk/vvZXC1SIu0HfQ9XF/eS6k9GpL1juts/401FTHG GrkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=Q3DLV6ehhtfx9md4k2gq+orCpUkjvjJgXu3lhHV7OLE=; fh=dqjoFo9c0lN3wRqwp5phCzwGqBFKsFsqmzK3Fczacb0=; b=ipaPA1mRPMjeNcK4j7jsGzx5iatQTnE6sgWeTWodU+d21tSnYIiUC0+d+VnN5jIjCk jDSJ5n4RbLMTYoJ+1y/KldnHKrP2qsB6R/Z34lWM4ZVUOlz2E++nirH47vL1p1IfWRsr o2knjn1wa+k3WGrLBDoHXBykX0m6pGKyaDOMNE1sBfhWK710FR+L9NlY7J9WvIuwww6q eca8AVfjR6kAv/ftNfJs5WS0intlussPLoTiM4Qofg9ZHkRSwANekYfT+yNHJwKbwaJl NZuVqPWeK1AxVsT/q9BfO711sQ3C0hB+zmrsnJjE3jXY5U/BAx73xWY9s9G19znoz2zk Kcyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-151204-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c22-20020a50f616000000b0056e73f4b8afsi1875479edn.570.2024.04.19.02.01.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:01:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151204-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-151204-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 816C01F21ABF for ; Fri, 19 Apr 2024 09:01:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7369C77F13; Fri, 19 Apr 2024 08:59:48 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFFA1757F7; Fri, 19 Apr 2024 08:59:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713517188; cv=none; b=iqb7oyhIMYo8ItjbERUbsGTMgP25xhp4lOsC09vljMSHNp1T10OU2ZvzRDg9fDH7DPqMzYBhunDe8UtvDu7T8I0uqsWMD8qCzGXvojKRkF0Vqb+TFx4/rc05/etCLoK03EYgyfHxmGE0pn5agxo0N9SwOaj3j9ND1jl3sFGqZxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713517188; c=relaxed/simple; bh=nrVql+dhu47+Yo4J4ftWOub8YL90A762db0V4CFPkks=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=M4LhrhbYIg3CmkELe/1g4ITPipIffJattVeoXIDuHNg6YfAe/Fci/4vctgAwGnLtBfHcCGwMw08MMTMqUDfjnWLTYOCD62Dl8jsCq14ZPkV+npxE10DOAKD+kPm8jqighNmLW+9X9MYa/bhM7GvHkYlJf08yIKxsIS6qts639E4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VLT685D5cz1N8Q2; Fri, 19 Apr 2024 16:56:48 +0800 (CST) Received: from dggpeml500023.china.huawei.com (unknown [7.185.36.114]) by mail.maildlp.com (Postfix) with ESMTPS id A0259140124; Fri, 19 Apr 2024 16:59:43 +0800 (CST) Received: from hulk-vt.huawei.com (10.67.174.26) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 19 Apr 2024 16:59:43 +0800 From: Xiu Jianfeng To: , , CC: , Subject: [PATCH -next] cgroup: avoid invalid loop in cgroup_no_v1() Date: Fri, 19 Apr 2024 08:53:16 +0000 Message-ID: <20240419085316.957277-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500023.china.huawei.com (7.185.36.114) We should break the for_each_subsys loop after the token matches the name of subsys and cgroup_no_v1_mask is set. Signed-off-by: Xiu Jianfeng --- kernel/cgroup/cgroup-v1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index 520a11cb12f4..b9dbf6bf2779 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -1335,6 +1335,7 @@ static int __init cgroup_no_v1(char *str) continue; cgroup_no_v1_mask |= 1 << i; + break; } } return 1; -- 2.34.1