[SRU][G/linux-oracle][PATCH 14/18] perf: arm-cmn: Fix unsigned comparison to less than zero

Khalid Elmously khalid.elmously at canonical.com
Fri May 21 07:00:38 UTC 2021


From: Will Deacon <will at kernel.org>

BugLink: https://bugs.launchpad.net/bugs/1925421

Ensure that the 'irq' field of 'struct arm_cmn_dtc' is a signed int
so that it can be compared '< 0'.

Link: https://lore.kernel.org/r/20200929170835.GA15956@embeddedor
Addresses-Coverity-ID: 1497488 ("Unsigned compared against 0")
Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
Reported-by: Gustavo A. R. Silva <gustavoars at kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars at kernel.org>
Signed-off-by: Will Deacon <will at kernel.org>
(cherry picked from commit d9ef632fab9ba81b708763bcbcfdbea9a55c95d2)
Signed-off-by: Khalid Elmously <khalid.elmously at canonical.com>
---
 drivers/perf/arm-cmn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 92dbea6633bc..cf85596f55ea 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -217,7 +217,7 @@ struct arm_cmn_node {
 
 struct arm_cmn_dtc {
 	void __iomem *base;
-	unsigned int irq;
+	int irq;
 	int irq_friend;
 	bool cc_active;
 
-- 
2.17.1




More information about the kernel-team mailing list