lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220705022557.19747-1-yang.lee@linux.alibaba.com>
Date:   Tue,  5 Jul 2022 10:25:57 +0800
From:   Yang Li <yang.lee@...ux.alibaba.com>
To:     rafael@...nel.org
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Yang Li <yang.lee@...ux.alibaba.com>
Subject: [PATCH -next] powercap: arm_scmi: Fix an ignored error return from num_domains_get()

On line 428 pr->num_zones = powercap_ops->num_domains_get(), the return
of num_domains_get() is int, it can be a negative error code, however
this is being assigned to an unsigned int variable, so make the num_zones
to int to solve this problem without affecting other functions.

Eliminate the following coccicheck warning:
./drivers/powercap/arm_scmi_powercap.c:429:5-18: WARNING: Unsigned expression compared with zero: pr -> num_zones < 0

Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
---
 drivers/powercap/arm_scmi_powercap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c
index 36f6dc211fbb..11018e63bb8b 100644
--- a/drivers/powercap/arm_scmi_powercap.c
+++ b/drivers/powercap/arm_scmi_powercap.c
@@ -29,7 +29,7 @@ struct scmi_powercap_zone {
 };
 
 struct scmi_powercap_root {
-	unsigned int num_zones;
+	int num_zones;
 	struct scmi_powercap_zone *spzones;
 	struct list_head *registered_zones;
 };
-- 
2.20.1.7.g153144c

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ