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.
@@ -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)
