From 1e006d81469a6a030eca124676c9bd1043d293c7 Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Mon, 31 Aug 2015 17:04:40 +0300 Subject: [PATCH] pci: Fix a vendor/device id bug where only one might be wrong Only one wrong is sufficient to fail the test: the found device is not the one we are looking up to. Change-Id: I2a54b5683fedf7d54de1e1553aecba40b6b6b2e1 Signed-off-by: Tomasz Bursztyka --- drivers/pci/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f5f6ea6a483..0ef3eaebcc6 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -336,8 +336,8 @@ static inline int pci_dev_scan(union pci_addr_reg pci_ctrl_addr, } if (lookup.info.vendor_id && lookup.info.device_id && - lookup.info.vendor_id != pci_dev_header.field.vendor_id && - lookup.info.device_id != pci_dev_header.field.device_id) { + (lookup.info.vendor_id != pci_dev_header.field.vendor_id || + lookup.info.device_id != pci_dev_header.field.device_id)) { continue; }