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]
Date:	Fri, 22 Jul 2016 21:55:49 +0800
From:	Wei Yongjun <weiyj.lk@...il.com>
To:	Matt Porter <mporter@...nel.crashing.org>,
	Alexandre Bounine <alexandre.bounine@....com>
Cc:	Wei Yongjun <weiyj.lk@...il.com>, linux-kernel@...r.kernel.org
Subject: [PATCH -next] rapidio/rio_cm: fix return value check in riocm_init()

In case of error, the function class_create() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Signed-off-by: Wei Yongjun <weiyj.lk@...il.com>
---
 drivers/rapidio/rio_cm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c
index 0683e5e..cecc15a 100644
--- a/drivers/rapidio/rio_cm.c
+++ b/drivers/rapidio/rio_cm.c
@@ -2288,9 +2288,9 @@ static int __init riocm_init(void)
 
 	/* Create device class needed by udev */
 	dev_class = class_create(THIS_MODULE, DRV_NAME);
-	if (!dev_class) {
+	if (IS_ERR(dev_class)) {
 		riocm_error("Cannot create " DRV_NAME " class");
-		return -EINVAL;
+		return PTR_ERR(dev_class);
 	}
 
 	ret = alloc_chrdev_region(&dev_number, 0, 1, DRV_NAME);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ