mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-09 10:36:03 +00:00
DM:fix suspicious dereference of pointer in 'pci_emul_deinit()
suspicious dereference of pointer 'fi->fi_devi' by passing it to function 'pci_emul_free_bars()' before NULL check. Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
@@ -792,10 +792,11 @@ pci_emul_deinit(struct vmctx *ctx, struct pci_vdev_ops *ops, int bus, int slot,
|
||||
if (fi->fi_param)
|
||||
free(fi->fi_param);
|
||||
|
||||
if (fi->fi_devi) {
|
||||
pci_emul_free_bars(fi->fi_devi);
|
||||
if (fi->fi_devi)
|
||||
free(fi->fi_devi);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
pci_populate_msicap(struct msicap *msicap, int msgnum, int nextptr)
|
||||
|
||||
Reference in New Issue
Block a user