Skip to content

Commit 5e680c1

Browse files
committed
scx_nest: fix unitialized value stats counter.
similar issue as sched-ext#3021 ==21167== Conditional jump or move depends on uninitialised value(s) ==21167== at 0x4A2C00A: __printf_buffer (vfprintf-process-arg.c:186) ==21167== by 0x4A2D787: __vfprintf_internal (vfprintf-internal.c:1543) ==21167== by 0x4A211F2: printf (printf.c:33) ==21167== by 0x4004F4E: main (in /home/dcarlier/Contribs/scx/build/scheds/c/scx_nest) ==21167== Uninitialised value was created by a stack allocation ==21167== at 0x4003B05: read_stats (in /home/dcarlier/Contribs/scx/build/scheds/c/scx_nest) Signed-off-by: David Carlier <[email protected]>
1 parent f24bae3 commit 5e680c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scheds/c/scx_nest.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ static void read_stats(struct scx_nest *skel, u64 *stats)
7272
u32 idx;
7373

7474
memset(stats, 0, sizeof(stats[0]) * NEST_STAT(NR));
75+
memset(cnts, 0, sizeof(cnts));
7576

7677
for (idx = 0; idx < NEST_STAT(NR); idx++) {
7778
int ret, cpu;

0 commit comments

Comments
 (0)