When a domain parameter is provided to pci_get_pdev_by_domain() the
search function would match against bus and devfn, 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
}
else
list_for_each_entry ( pdev, &d->pdev_list, domain_list )
- if ( pdev->bus == bus && pdev->devfn == devfn )
+ if ( pdev->seg == seg && pdev->bus == bus && pdev->devfn == devfn )
return pdev;
return NULL;