From: Jan Beulich Date: Wed, 7 Feb 2018 15:30:24 +0000 (+0100) Subject: PCI/passthrough: don't discard Dom0 provided information X-Git-Tag: 4.11.0-rc1~439 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c5d981c5538284726ad75c852bb4f57ee8bae916;p=xen.git PCI/passthrough: don't discard Dom0 provided information Instead of giving, to subsequent code, the appearance of there not having been any "info" data provided, adjust the conditional guarding SR-IOV handling. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 469dfc6c3d..2b976ade62 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -629,10 +629,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, else if ( info->is_extfn ) pdev_type = "extended function"; else - { - info = NULL; pdev_type = "device"; - } ret = xsm_resource_plug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | devfn); if ( ret ) @@ -660,7 +657,8 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, if ( pdev->info.is_virtfn ) pdev->info.is_extfn = pf_is_extfn; } - else if ( !pdev->vf_rlen[0] ) + + if ( !pdev->info.is_virtfn && !pdev->vf_rlen[0] ) { unsigned int pos = pci_find_ext_capability(seg, bus, devfn, PCI_EXT_CAP_ID_SRIOV);