Skip to content

Commit

Permalink
hv: vtd: fix use of uninitialized variable in dmar_free_irte
Browse files Browse the repository at this point in the history
This patch fixes the following error:
  error: variable 'sid' is used uninitialized whenever 'if' condition is true
  [-Werror,-Wsometimes-uninitialized]

Tracked-On: projectacrn#861

Signed-off-by: Gao, Shiqing <[email protected]>
  • Loading branch information
shiqingg authored and acrnsi-robot committed Jul 3, 2024
1 parent 2aed0c7 commit 0bcf469
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hypervisor/arch/x86/vtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0bcf469

Please sign in to comment.