mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 12:42:54 +00:00
hv: assign: fix MISRA-C violations on potential null pointer deference
This patch fix the MISRA-C violations in arch/x86/assign.c on potential null pointer deference. Also add a break in case statement. Tracked-On: #861 Signed-off-by: Binbin Wu <binbin.wu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
e19dcf5735
commit
e8b3e44fc0
@ -470,22 +470,20 @@ void ptirq_softirq(uint16_t pcpu_id)
|
||||
if (entry->intr_type == PTDEV_INTR_INTX) {
|
||||
ptirq_handle_intx(vm, entry);
|
||||
} else {
|
||||
if (msi != NULL) {
|
||||
/* TODO: msi destmode check required */
|
||||
(void)vlapic_intr_msi(vm,
|
||||
msi->vmsi_addr,
|
||||
msi->vmsi_data);
|
||||
dev_dbg(ACRN_DBG_PTIRQ,
|
||||
"dev-assign: irq=0x%x MSI VR: 0x%x-0x%x",
|
||||
(void)vlapic_intr_msi(vm, msi->vmsi_addr, msi->vmsi_data);
|
||||
dev_dbg(ACRN_DBG_PTIRQ, "dev-assign: irq=0x%x MSI VR: 0x%x-0x%x",
|
||||
entry->allocated_pirq,
|
||||
msi->vmsi_data & 0xFFU,
|
||||
irq_to_vector(entry->allocated_pirq));
|
||||
dev_dbg(ACRN_DBG_PTIRQ,
|
||||
" vmsi_addr: 0x%llx vmsi_data: 0x%x",
|
||||
dev_dbg(ACRN_DBG_PTIRQ, " vmsi_addr: 0x%llx vmsi_data: 0x%x",
|
||||
msi->vmsi_addr,
|
||||
msi->vmsi_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ptirq_intx_ack(struct acrn_vm *vm, uint8_t virt_pin,
|
||||
enum ptirq_vpin_source vpin_src)
|
||||
@ -511,6 +509,7 @@ void ptirq_intx_ack(struct acrn_vm *vm, uint8_t virt_pin,
|
||||
break;
|
||||
case PTDEV_VPIN_PIC:
|
||||
vpic_set_irq(vm, virt_pin, GSI_SET_LOW);
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
* In this switch statement, vpin_src shall either be
|
||||
|
Loading…
Reference in New Issue
Block a user