[PATCH 2.6] Fix off-by-one in pci_enable_wake

From: Roger Luethi
Date: Mon Jun 14 2004 - 12:25:13 EST


Fix off-by-one in pci_enable_wake.
Bit field location determined by mask, not value.

Signed-off-by: Roger Luethi <rl@xxxxxxxxxxx>

--- linux-2.6.7-rc3-bk6/drivers/pci/pci.c.orig 2004-06-14 18:42:09.561442345 +0200
+++ linux-2.6.7-rc3-bk6/drivers/pci/pci.c 2004-06-14 18:43:15.083670484 +0200
@@ -442,7 +442,7 @@
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)))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/