From 0bcf469758b32f1a03c88acbfe4495c35e72cf0b Mon Sep 17 00:00:00 2001 From: "Gao, Shiqing" Date: Wed, 3 Jul 2024 10:35:28 +0800 Subject: [PATCH] hv: vtd: fix use of uninitialized variable in dmar_free_irte This patch fixes the following error: error: variable 'sid' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] Tracked-On: #861 Signed-off-by: Gao, Shiqing --- hypervisor/arch/x86/vtd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c index 04171d5c8..170d856cb 100644 --- a/hypervisor/arch/x86/vtd.c +++ b/hypervisor/arch/x86/vtd.c @@ -1398,6 +1398,7 @@ void dmar_free_irte(const struct intr_source *intr_src, uint16_t index) if (intr_src->is_msi) { dmar_unit = device_to_dmaru((uint8_t)intr_src->src.msi.bits.b, intr_src->src.msi.fields.devfun); + sid.value = (uint16_t)(intr_src->src.msi.value); } else { dmar_unit = ioapic_to_dmaru(intr_src->src.ioapic_id, &sid); }