From: Tal Shnaiderman Date: Wed, 14 Oct 2020 19:30:01 +0000 (+0300) Subject: bus/pci: clear undefined bits in Windows segment parsing X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c12b14889e30f1c984b67a64044206aa1a7c704d;p=dpdk.git bus/pci: clear undefined bits in Windows segment parsing When reading bus and segment values using SPDRP_BUSNUMBER bits 24-31 are undefined. They are cleared to verify we read the segment number correctly. Fixes: c3adf8144a17 ("bus/pci: support segment as address domain on Windows") Cc: stable@dpdk.org Signed-off-by: Tal Shnaiderman Acked-by: Ranjit Menon Acked-by: Narcisa Vasile --- diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index b77b1b6451..10bb0e9cf1 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -195,7 +195,7 @@ get_device_pci_address(HDEVINFO dev_info, return -1; } - addr->domain = bus_num >> 8; + addr->domain = (bus_num >> 8) & 0xffff; addr->bus = bus_num & 0xff; addr->devid = dev_and_func >> 16; addr->function = dev_and_func & 0xffff;