[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200619201219.32126-2-refactormyself@gmail.com>
Date: Fri, 19 Jun 2020 22:12:18 +0200
From: refactormyself@...il.com
To: helgaas@...nel.org
Cc: Bolarinwa Olayemi Saheed <refactormyself@...il.com>,
bjorn@...gaas.com, linux-pci@...r.kernel.org,
skhan@...uxfoundation.org,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] PCI/PME: Fix wrong failure check on pcie_capability_read_*()
From: Bolarinwa Olayemi Saheed <refactormyself@...il.com>
On failure, pcie_capabiility_read_*() will set rtsta to 0 and not ~0.
This bug fix checks for the proper value.
Signed-off-by: Bolarinwa Olayemi Saheed <refactormyself@...il.com>
---
drivers/pci/pcie/pme.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index 6a32970bb731..1d1d06f06335 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -224,7 +224,7 @@ static void pcie_pme_work_fn(struct work_struct *work)
break;
pcie_capability_read_dword(port, PCI_EXP_RTSTA, &rtsta);
- if (rtsta == (u32) ~0)
+ if (rtsta == (u32)0)
break;
if (rtsta & PCI_EXP_RTSTA_PME) {
@@ -274,7 +274,7 @@ static irqreturn_t pcie_pme_irq(int irq, void *context)
spin_lock_irqsave(&data->lock, flags);
pcie_capability_read_dword(port, PCI_EXP_RTSTA, &rtsta);
- if (rtsta == (u32) ~0 || !(rtsta & PCI_EXP_RTSTA_PME)) {
+ if (rtsta == (u32)0 || !(rtsta & PCI_EXP_RTSTA_PME)) {
spin_unlock_irqrestore(&data->lock, flags);
return IRQ_NONE;
}
--
2.18.2
Powered by blists - more mailing lists