From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] linux: __get_nprocs_sched: initialize cpu_bits array with zeroes [BZ #28850]
Date: Wed, 2 Feb 2022 01:14:56 +0300 [thread overview]
Message-ID: <20220201221456.GA6227@altlinux.org> (raw)
In-Reply-To: <20220201215644.473902-1-glebfm@altlinux.org>
On Tue, Feb 01, 2022 at 09:56:44PM +0000, Gleb Fotengauer-Malinovskiy wrote:
> ---
> 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);
Good catch!
Please cast cpu_bits to "cpu_set_t*" to make this CPU_ZERO_S invocation
consistent with the CPU_COUNT_S invocation below.
Also, please add a space between CPU_ZERO_S and the opening parenthesis.
--
ldv
prev parent reply other threads:[~2022-02-01 22:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 21:56 Gleb Fotengauer-Malinovskiy
2022-02-01 22:14 ` [PATCH v2] " Gleb Fotengauer-Malinovskiy
2022-02-01 22:22 ` Dmitry V. Levin
2022-02-01 22:33 ` Andreas Schwab
2022-02-01 22:44 ` [PATCH v3] linux: __get_nprocs_sched: do not feed CPU_COUNT_S with garbage " Gleb Fotengauer-Malinovskiy
2022-02-01 22:46 ` Dmitry V. Levin
2022-02-01 22:14 ` Dmitry V. Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220201221456.GA6227@altlinux.org \
--to=ldv@altlinux.org \
--cc=glebfm@altlinux.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).