From patchwork Tue Feb 1 22:14:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Fotengauer-Malinovskiy X-Patchwork-Id: 50655 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 222BB385C41C for ; Tue, 1 Feb 2022 22:14:21 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by sourceware.org (Postfix) with ESMTP id ACD95385840B for ; Tue, 1 Feb 2022 22:14:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ACD95385840B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=altlinux.org Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38]) by vmicros1.altlinux.org (Postfix) with ESMTP id 0DA4172C8FA for ; Wed, 2 Feb 2022 01:14:09 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by imap.altlinux.org (Postfix) with ESMTP id E5C094A46F0; Wed, 2 Feb 2022 01:14:08 +0300 (MSK) From: Gleb Fotengauer-Malinovskiy To: libc-alpha@sourceware.org Subject: [PATCH v2] linux: __get_nprocs_sched: initialize cpu_bits array with zeroes [BZ #28850] Date: Tue, 1 Feb 2022 22:14:07 +0000 Message-Id: <20220201221407.500964-1-glebfm@altlinux.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220201215644.473902-1-glebfm@altlinux.org> References: MIME-Version: 1.0 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" --- sysdeps/unix/sysv/linux/getsysstats.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Dmitry V. Levin diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c index 4798cc337e..b0a7663f56 100644 --- a/sysdeps/unix/sysv/linux/getsysstats.c +++ b/sysdeps/unix/sysv/linux/getsysstats.c @@ -41,6 +41,7 @@ __get_nprocs_sched (void) /* This cannot use malloc because it is used on malloc initialization. */ __cpu_mask cpu_bits[cpu_bits_size / sizeof (__cpu_mask)]; + CPU_ZERO_S (cpu_bits_size, (cpu_set_t*) cpu_bits); int r = INTERNAL_SYSCALL_CALL (sched_getaffinity, 0, cpu_bits_size, cpu_bits); if (r > 0)