[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.17] pci: fix pci_get_pdev() to always account for the segment



commit 47eb94123035a2987dd1e328e9adec6db36e7fb3
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Tue May 23 14:56:35 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue May 23 14:56:35 2023 +0200

    pci: fix pci_get_pdev() to always account for the segment
    
    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@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: c7908869ac26961a3919491705e521179ad3fc0e
    master date: 2023-05-22 16:11:55 +0200
---
 xen/drivers/passthrough/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index b42acb8d7c..07d1986d33 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -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;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.