void vpci_remove_device(struct pci_dev *pdev)
{
- if ( !has_vpci(pdev->domain) )
+ if ( !has_vpci(pdev->domain) || !pdev->vpci )
return;
spin_lock(&pdev->vpci->lock);
/* Find the PCI dev matching the address. */
pdev = pci_get_pdev(d, sbdf);
- if ( !pdev )
+ if ( !pdev || !pdev->vpci )
return vpci_read_hw(sbdf, reg, size);
spin_lock(&pdev->vpci->lock);
* Passthrough everything that's not trapped.
*/
pdev = pci_get_pdev(d, sbdf);
- if ( !pdev )
+ if ( !pdev || !pdev->vpci )
{
vpci_write_hw(sbdf, reg, size, data);
return;