mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-03 01:44:55 +00:00
hv: bugfix for hv-emulated device de-init
- fix bug in 'hcall_destroy_vdev()', the availability of vpci device shall be checked on 'target_vm". - refine 'vpci_update_one_vbar()' to avoid potential NULL pointer access. Tracked-On: #5490 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
@@ -1241,7 +1241,7 @@ int32_t hcall_destroy_vdev(struct acrn_vm *vm, struct acrn_vm *target_vm, __unus
|
||||
op = find_emul_dev_ops(&dev);
|
||||
if (op != NULL) {
|
||||
bdf.value = (uint16_t) dev.slot;
|
||||
vdev = pci_find_vdev(&vm->vpci, bdf);
|
||||
vdev = pci_find_vdev(&target_vm->vpci, bdf);
|
||||
if (vdev != NULL) {
|
||||
vdev->pci_dev_config->vbdf.value = UNASSIGNED_VBDF;
|
||||
if (op->destroy != NULL) {
|
||||
|
Reference in New Issue
Block a user