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:
parent
03ae242eb7
commit
4ed6d92226
|
@ -792,10 +792,11 @@ pci_emul_deinit(struct vmctx *ctx, struct pci_vdev_ops *ops, int bus, int slot,
|
||||||
if (fi->fi_param)
|
if (fi->fi_param)
|
||||||
free(fi->fi_param);
|
free(fi->fi_param);
|
||||||
|
|
||||||
|
if (fi->fi_devi) {
|
||||||
pci_emul_free_bars(fi->fi_devi);
|
pci_emul_free_bars(fi->fi_devi);
|
||||||
if (fi->fi_devi)
|
|
||||||
free(fi->fi_devi);
|
free(fi->fi_devi);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
pci_populate_msicap(struct msicap *msicap, int msgnum, int nextptr)
|
pci_populate_msicap(struct msicap *msicap, int msgnum, int nextptr)
|
||||||
|
|
Loading…
Reference in New Issue