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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220906142337.1697569-4-cristian.marussi@arm.com>
Date:   Tue,  6 Sep 2022 15:23:37 +0100
From:   Cristian Marussi <cristian.marussi@....com>
To:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-pm@...r.kernel.org
Cc:     sudeep.holla@....com, james.quinlan@...adcom.com,
        Jonathan.Cameron@...wei.com, f.fainelli@...il.com,
        etienne.carriere@...aro.org, vincent.guittot@...aro.org,
        daniel.lezcano@...aro.org, tarek.el-sherbiny@....com,
        adrian.slatineanu@....com, souvik.chakravarty@....com,
        wleavitt@...vell.com, wbartczak@...vell.com,
        dan.carpenter@...cle.com, lukasz.luba@....com
Subject: [PATCH v2 3/3] powercap: arm_scmi: Fix a NULL vs IS_ERR() bug

From: Dan Carpenter <dan.carpenter@...cle.com>

The powercap_register_control_type() return error pointers.  It never
returns NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
 drivers/powercap/arm_scmi_powercap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c
index 76200c004cad..05d0e516176a 100644
--- a/drivers/powercap/arm_scmi_powercap.c
+++ b/drivers/powercap/arm_scmi_powercap.c
@@ -485,8 +485,8 @@ static int __init scmi_powercap_init(void)
 	int ret;
 
 	scmi_top_pcntrl = powercap_register_control_type(NULL, "arm-scmi", NULL);
-	if (!scmi_top_pcntrl)
-		return -ENODEV;
+	if (IS_ERR(scmi_top_pcntrl))
+		return PTR_ERR(scmi_top_pcntrl);
 
 	ret = scmi_register(&scmi_powercap_driver);
 	if (ret)
-- 
2.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ