Skip to content

Commit 67ebd81

Browse files
committed
PCI: Fix incorrect vgaarb conditional in WARN_ON()
3448a19 "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: 3448a19 "vgaarb: use bridges to control VGA routing where possible" Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Yinghai Lu <[email protected]> Acked-by: David Airlie <[email protected]>
1 parent c130904 commit 67ebd81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4125,7 +4125,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
41254125
u16 cmd;
41264126
int rc;
41274127

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)));
41294129

41304130
/* ARCH specific VGA enables */
41314131
rc = pci_set_vga_state_arch(dev, decode, command_bits, flags);

0 commit comments

Comments
 (0)