Commit 4cd5d72a authored by Roger Luethi's avatar Roger Luethi Committed by Greg Kroah-Hartman

[PATCH] PCI: Fix off-by-one in pci_enable_wake

Fix off-by-one in pci_enable_wake.
Bit field location determined by mask, not value.
Signed-off-by: default avatarRoger Luethi <rl@hellgate.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 9406e29e
......@@ -442,7 +442,7 @@ int pci_enable_wake(struct pci_dev *dev, u32 state, int enable)
pci_read_config_word(dev,pm+PCI_PM_PMC,&value);
value &= PCI_PM_CAP_PME_MASK;
value >>= ffs(value); /* First bit of mask */
value >>= ffs(PCI_PM_CAP_PME_MASK) - 1; /* First bit of mask */
/* Check if it can generate PME# from requested state. */
if (!value || !(value & (1 << state)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment