From nobody Wed Dec 17 08:35:12 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C220C4332F for ; Tue, 12 Dec 2023 04:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231416AbjLLEV0 (ORCPT ); Mon, 11 Dec 2023 23:21:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjLLEVM (ORCPT ); Mon, 11 Dec 2023 23:21:12 -0500 Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13D09BE for ; Mon, 11 Dec 2023 20:21:19 -0800 (PST) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-5e1e656d019so2479317b3.1 for ; Mon, 11 Dec 2023 20:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702354878; x=1702959678; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pqzdM1JWQlsu7k/N7xBtV+SLaOrDoqGHT+SByeHgWqU=; b=UC6d6PO3w2NZb5d9tH0UdWas3rs/ZjAl8v6ylZ9E3ARFTOUXyTe0/WRsugYKxN1PUC yGXhWx7auSab/uE99Hw5eOfSCWAVKKzvcV0/95TYjOreSlSip1IZgfQmDbkFy90dl+DR wVdWg/xq26ELYqUJ4WGF0K7DY75R+WzgUO9oUM2Pf3K+zfNbTwnRSvgMP0VloIoy720t 27drinVXkFUosKN4/8P7IpS9hqEQgbml8ginjsHnVL3MREfq3i3AYRie8UJ6gpypaUrQ A4ALxWCt3MQYm6P7A+MzDEPpx3r1loiwRaH8G34hs7Ylghw5GdXrlRoH4z4aXMxj0qY3 MVig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702354878; x=1702959678; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pqzdM1JWQlsu7k/N7xBtV+SLaOrDoqGHT+SByeHgWqU=; b=r9fYSdaN/bzt1lYXPDRBvo9yzD5/3ZC92Vkb6RCoikEKyUpQI/d0xl19HaW6z0ep1m K9eGhRkJVdHMM+qHs7AEVrCAmelUYbQ1Vpz81s8fv7RtvhwVAuwUlqxUAP8kLO8epAXH 3rZj7R+5JNV2OEgoAWZ+c544KbZj58D/uw9Kb2UyCEWlV2+GRayDwvVuBmCyRFggGGkH FDXQqacw+cT4NebawJureaKvKFoARG24nV/LiQpGqX2zYhUKwgO/YJ8sbXrEdx+Bzyq1 vafXlqgxqdnEHdlsiHNLAS7FgQzISUzunfcBgRwuPL/9pGM43N/M9dEoYEF6uRvOh+Oy PXSQ== X-Gm-Message-State: AOJu0YzcV/tKw98sNaV3IUes5c85siBq4K1K7DI7BRqNqhOMolHy91jC BRKEnljsLW7D21lHH+02VIY= X-Google-Smtp-Source: AGHT+IEpOxgjKzCRWRfaNbZ9gq8uVyIb3GxyH8tmiruZoPiABPHG5lIqbyLddNf9/MgHO/C8v1nIlg== X-Received: by 2002:a81:7188:0:b0:5d7:1941:2c23 with SMTP id m130-20020a817188000000b005d719412c23mr4611909ywc.80.1702354878116; Mon, 11 Dec 2023 20:21:18 -0800 (PST) Received: from localhost ([2601:344:8301:57f0:38aa:1c88:df05:9b73]) by smtp.gmail.com with ESMTPSA id en9-20020a05690c2b8900b005de84505114sm3311734ywb.58.2023.12.11.20.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 20:21:17 -0800 (PST) From: Yury Norov To: Andrew Morton , Thomas Gleixner , Ming Lei , linux-kernel@vger.kernel.org Cc: Yury Norov , Andy Shevchenko , Rasmus Villemoes Subject: [PATCH v3 5/7] lib/cgroup_cpus: don't zero cpumasks in group_cpus_evenly() on allocation Date: Mon, 11 Dec 2023 20:21:05 -0800 Message-Id: <20231212042108.682072-6-yury.norov@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231212042108.682072-1-yury.norov@gmail.com> References: <20231212042108.682072-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" nmsk and npresmsk are both allocated with zalloc_cpumask_var(), but they are initialized by copying later in the code, and so may be allocated uninitialized. Signed-off-by: Yury Norov --- lib/group_cpus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/group_cpus.c b/lib/group_cpus.c index cded3c8ea63b..c7fcd04c87bf 100644 --- a/lib/group_cpus.c +++ b/lib/group_cpus.c @@ -347,10 +347,10 @@ struct cpumask *group_cpus_evenly(unsigned int numgrp= s) int ret =3D -ENOMEM; struct cpumask *masks =3D NULL; =20 - if (!zalloc_cpumask_var(&nmsk, GFP_KERNEL)) + if (!alloc_cpumask_var(&nmsk, GFP_KERNEL)) return NULL; =20 - if (!zalloc_cpumask_var(&npresmsk, GFP_KERNEL)) + if (!alloc_cpumask_var(&npresmsk, GFP_KERNEL)) goto fail_nmsk; =20 node_to_cpumask =3D alloc_node_to_cpumask(); --=20 2.40.1