Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4411013rdb; Mon, 11 Dec 2023 20:21:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJAPOjW51HupxHOhFsFerNTzHWQBfb1NlJ5f8DXUnUlO7qhpsK7XQBgT8GwiS7HdAiXZn1 X-Received: by 2002:a05:6a20:3942:b0:18d:b43:78ea with SMTP id r2-20020a056a20394200b0018d0b4378eamr7770198pzg.43.1702354908341; Mon, 11 Dec 2023 20:21:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702354908; cv=none; d=google.com; s=arc-20160816; b=j0hbwn9Wp5clZ3SPpEe3px0XrhqzyeoqRBiUr3UOt+CRnZ4p+fmIVtHJLUoIKzftm6 c+D5YbRNmP+pof23TG58JqZ+D4sJ3YyQ1wd7H2P5+dMZ4mpHkmFqOmIgryJryC6D5XHl Y26NsZcC4Cp3YcaB9uf9fk3QAte2cfQGoQqBEBLCQWlM/MsNRUdw3+mTMPpn/wDNYavh jpJsRYFZX6hgqfxS1txF4/pJ4PBUMwV4SgzBecvM8a9a/BG88TvkD0l44Cc62+Dxn4+Q CZ4yUFoUBlrkxpUgAv1iNyY22vbWp0X1h9WL1/LI0scDoIkcJ+yN2sPsoRDdNPUbUQAF Ax1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pqzdM1JWQlsu7k/N7xBtV+SLaOrDoqGHT+SByeHgWqU=; fh=kL/RA2Gd9NuQcovU0+7My8qgZ6xDrReyLO6zCGgffAQ=; b=YkyC0/EbxJ/Vd2zsXBKuuIK7Vmf3BAzb3mHt7NYp4Ycehi+i0JcF9JyRch8cjofQcu Lsz0Sc5q8rmNUEgiE2Vr52GhwCKDfwk7e8sVaZOcYHuztkgAMoRVE/lnSEa10z7XHRqK gkW6+416En/5rLxvxvOMCr0MrQBw06W/2lgrBz/tgBqI43MtkST0FRH9HFQveWGtIC7f 1XlCKHbkMLHqJRBH0opRU5CxK7CrNGRVsr8uLcg91531ArvLoH41NrwJahm8oaTxSnRG sF37AiiEv4UeTKGZLNkjdGbJBDYRK8LIfY8ofs02ZsX+7xEPawbybVsZwbnyr3zqAf0I Zrug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UC6d6PO3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id bq13-20020a056a02044d00b005be00224982si7476953pgb.381.2023.12.11.20.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 20:21:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UC6d6PO3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 0F6D480CF50F; Mon, 11 Dec 2023 20:21:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234938AbjLLEVY (ORCPT + 99 others); Mon, 11 Dec 2023 23:21:24 -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-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: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 20:21:46 -0800 (PST) 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 numgrps) int ret = -ENOMEM; struct cpumask *masks = NULL; - if (!zalloc_cpumask_var(&nmsk, GFP_KERNEL)) + if (!alloc_cpumask_var(&nmsk, GFP_KERNEL)) return NULL; - if (!zalloc_cpumask_var(&npresmsk, GFP_KERNEL)) + if (!alloc_cpumask_var(&npresmsk, GFP_KERNEL)) goto fail_nmsk; node_to_cpumask = alloc_node_to_cpumask(); -- 2.40.1