Skip to contentSkip to conversation

Fix off-by-one in pci_enable_wake

PATCH Applied Roger Luethi 2 participants 2 messages Jun 14, 2004 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix off-by-one in pci_enable_wake

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

drivers/pci/pci.c renamed from drivers/pci/pci.c.orig +1 -1
@@ -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))) 
Applied
#1 lore raw
Quoted 2 lines · Roger Luethi

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

Applied, thanks.

greg k-h