From patchwork Tue Feb 1 21:56:44 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: 50652 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 E941D385DC39 for ; Tue, 1 Feb 2022 21:58:27 +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 BD0A4385C409 for ; Tue, 1 Feb 2022 21:56:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD0A4385C409 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 E846E72C8FA for ; Wed, 2 Feb 2022 00:56:45 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by imap.altlinux.org (Postfix) with ESMTP id 9C5BF4A46F0; Wed, 2 Feb 2022 00:56:45 +0300 (MSK) From: Gleb Fotengauer-Malinovskiy To: libc-alpha@sourceware.org Subject: [PATCH] linux: __get_nprocs_sched: initialize cpu_bits array with zeroes [BZ #28850] Date: Tue, 1 Feb 2022 21:56:44 +0000 Message-Id: <20220201215644.473902-1-glebfm@altlinux.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.0 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(+) diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c index 4798cc337e..5436bdb507 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_bits); int r = INTERNAL_SYSCALL_CALL (sched_getaffinity, 0, cpu_bits_size, cpu_bits); if (r > 0)