From 418d8f0dc269b314bba51de63869b20da1d9a76e Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 22 Nov 2024 13:50:26 +0000 Subject: [PATCH] dtrace: Address KMSAN warnings in dtrace_disx86 wbit was not being initialized in a couple of cases. Reported by: asomers MFC after: 2 weeks --- sys/cddl/dev/dtrace/x86/dis_tables.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/cddl/dev/dtrace/x86/dis_tables.c b/sys/cddl/dev/dtrace/x86/dis_tables.c index 1afadc94afc2..44c96437055b 100644 --- a/sys/cddl/dev/dtrace/x86/dis_tables.c +++ b/sys/cddl/dev/dtrace/x86/dis_tables.c @@ -3720,8 +3720,8 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) x->d86_len = 0; x->d86_rmindex = -1; x->d86_error = 0; -#ifdef DIS_TEXT x->d86_numopnds = 0; +#ifdef DIS_TEXT x->d86_seg_prefix = NULL; x->d86_mnem[0] = 0; for (i = 0; i < 4; ++i) { @@ -4860,6 +4860,7 @@ mm_shift: dtrace_rex_adjust(rex_prefix, mode, NULL, &r_m); dtrace_get_operand(x, mode, r_m, LONG_OPND, vbit); dtrace_get_operand(x, REG_ONLY, reg, SEG_OPND, 1 - vbit); + wbit = SEG_OPND; break; /* @@ -5787,6 +5788,7 @@ xmmprm: #endif dtrace_rex_adjust(rex_prefix, mode, ®, &r_m); dtrace_get_operand(x, mode, r_m, BYTE_OPND, 0); + wbit = LONG_OPND; } break; @@ -6442,7 +6444,7 @@ done: else x->d86_memsize = dp->it_size; - } else if (wbit == 0) { + } else if (wbit == BYTE_OPND) { x->d86_memsize = 1; } else if (wbit == LONG_OPND) {