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-next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd9DJxmadJQb_0-J_2DZ1aVpOZ65J4iVCid-tJ=OLmKBNA@mail.gmail.com>
Date:	Tue, 7 Jan 2014 16:56:35 +0800
From:	Wei Yongjun <weiyj.lk@...il.com>
To:	haver@...ux.vnet.ibm.com, gregkh@...uxfoundation.org
Cc:	yongjun_wei@...ndmicro.com.cn, linux-kernel@...r.kernel.org
Subject: [PATCH -next] misc: genwqe: fix return value check in genwqe_device_create()

From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>

In case of error, the function device_create_with_groups()
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 <yongjun_wei@...ndmicro.com.cn>
---
 drivers/misc/genwqe/card_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c
index 9b231bb..46fa2ca 100644
--- a/drivers/misc/genwqe/card_dev.c
+++ b/drivers/misc/genwqe/card_dev.c
@@ -1378,8 +1378,8 @@ int genwqe_device_create(struct genwqe_dev *cd)
 					    genwqe_attribute_groups,
 					    GENWQE_DEVNAME "%u_card",
 					    cd->card_idx);
-	if (cd->dev == NULL) {
-		rc = -ENODEV;
+	if (IS_ERR(cd->dev)) {
+		rc = PTR_ERR(cd->dev);
 		goto err_cdev;
 	}
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ