public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] linux: __get_nprocs_sched: initialize cpu_bits array with zeroes [BZ #28850]
@ 2022-02-01 21:56 Gleb Fotengauer-Malinovskiy
  2022-02-01 22:14 ` [PATCH v2] " Gleb Fotengauer-Malinovskiy
  2022-02-01 22:14 ` [PATCH] linux: __get_nprocs_sched: initialize cpu_bits array with zeroes " Dmitry V. Levin
  0 siblings, 2 replies; 7+ messages in thread
From: Gleb Fotengauer-Malinovskiy @ 2022-02-01 21:56 UTC (permalink / raw)
  To: 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)
-- 
glebfm


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-01 22:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01 21:56 [PATCH] linux: __get_nprocs_sched: initialize cpu_bits array with zeroes [BZ #28850] 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 ` [PATCH] linux: __get_nprocs_sched: initialize cpu_bits array with zeroes " Dmitry V. Levin

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).