pci: fix handling of PCI bridges with subordinate bus number 0xff
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Tue, 28 Sep 2021 14:04:50 +0000 (16:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 28 Sep 2021 14:04:50 +0000 (16:04 +0200)
commit9c3b9800e2019c93ab22da69e4a0b22d6fb059ec
tree0b1c7e31b8241fe4f88a602ea5ff0924267c6ca4
parent1578322ac6bc4d66800a5a3caf6685f556b64054
pci: fix handling of PCI bridges with subordinate bus number 0xff

Bus number 0xff is valid according to the PCI spec. Using u8 typed sub_bus
and assigning 0xff to it will result in the following loop getting stuck.

    for ( ; sec_bus <= sub_bus; sec_bus++ ) {...}

Just change its type to unsigned int similarly to what is already done in
dmar_scope_add_buses().

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
xen/drivers/passthrough/pci.c