The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Roger Luethi <rl@hellgate.ch>
To: Andrew Morton <akpm@osdl.org>
Cc: Greg Kroah-Hartman <greg@kroah.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 2.6] Fix off-by-one in pci_enable_wake
Date: Mon, 14 Jun 2004 19:22:25 +0200	[thread overview]
Message-ID: <20040614172225.GA23014@k3.hellgate.ch> (raw)

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

Signed-off-by: Roger Luethi <rl@hellgate.ch>

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

             reply	other threads:[~2004-06-14 17:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-14 17:22 Roger Luethi [this message]
2004-06-14 17:57 ` [PATCH 2.6] Fix off-by-one in pci_enable_wake Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040614172225.GA23014@k3.hellgate.ch \
    --to=rl@hellgate.ch \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox