]> xenbits.xensource.com Git - xen.git/commitdiff
pci: fix pci_get_pdev() to always account for the segment
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 23 May 2023 12:56:35 +0000 (14:56 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 23 May 2023 12:56:35 +0000 (14:56 +0200)
When a domain parameter is provided to pci_get_pdev() the search
function would match against the bdf, without taking the segment into
account.

Fix this and also account for the passed segment.

Fixes: 8cf6e0738906 ('PCI: simplify (and thus correct) pci_get_pdev{,_by_domain}()')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: c7908869ac26961a3919491705e521179ad3fc0e
master date: 2023-05-22 16:11:55 +0200

xen/drivers/passthrough/pci.c

index b42acb8d7c091932825f60e97bdc86b1a466d026..07d1986d330ae567ab6e6b92b5995230fd6cac63 100644 (file)
@@ -552,7 +552,7 @@ struct pci_dev *pci_get_pdev(const struct domain *d, pci_sbdf_t sbdf)
     }
     else
         list_for_each_entry ( pdev, &d->pdev_list, domain_list )
-            if ( pdev->sbdf.bdf == sbdf.bdf )
+            if ( pdev->sbdf.sbdf == sbdf.sbdf )
                 return pdev;
 
     return NULL;