aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-04-05 17:14:22 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-04-25 13:19:06 -0400
commit67ebd8140dc8923c65451fa0f6a8eee003c4dcd3 (patch)
tree23c3dfa6a8a664116e33d5c74ee39e8ee96fe987 /drivers/pci
parentc1309040967e200d3ea6415ae54cf6a69d7ad996 (diff)
PCI: Fix incorrect vgaarb conditional in WARN_ON()
3448a19da479 "vgaarb: use bridges to control VGA routing where possible" added the "flags & PCI_VGA_STATE_CHANGE_DECODES" condition to an existing WARN_ON(), but used bitwise AND (&) instead of logical AND (&&), so the condition is never true. Replace with logical AND. Found by Coverity (CID 142811). Fixes: 3448a19da479 "vgaarb: use bridges to control VGA routing where possible" Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Acked-by: David Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7325d43bf030..39012831867e 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4125,7 +4125,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
4125 u16 cmd; 4125 u16 cmd;
4126 int rc; 4126 int rc;
4127 4127
4128 WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) & (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY))); 4128 WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) && (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)));
4129 4129
4130 /* ARCH specific VGA enables */ 4130 /* ARCH specific VGA enables */
4131 rc = pci_set_vga_state_arch(dev, decode, command_bits, flags); 4131 rc = pci_set_vga_state_arch(dev, decode, command_bits, flags);