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:	Mon,  6 Aug 2012 02:58:47 +0545
From:	Devendra Naga <develkernel412222@...il.com>
To:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Cc:	Naren Sankar <nsankar@...adcom.com>,
	Jarod Wilson <jarod@...sonet.com>,
	Scott Davilla <davilla@....com>,
	Manu Abraham <abraham.manu@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jorgyano Vieira <jorgyano@...il.com>,
	Devendra Naga <develkernel412222@...il.com>
Subject: [PATCH 1/2] staging/crystalhd: assign PTR_ERR at fail cases to rc in chd_dec_init_chdev

the rc assignment to PTR_ERR at fail cases of class_create and device_create are missed out,
return proper error rather than returning -ENODEV.

Signed-off-by: Devendra Naga <develkernel412222@...il.com>
---
 drivers/staging/crystalhd/crystalhd_lnx.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index d9e3d61..0582ac0 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -373,6 +373,7 @@ static int __devinit chd_dec_init_chdev(struct crystalhd_adp *adp)
 	/* register crystalhd class */
 	crystalhd_class = class_create(THIS_MODULE, "crystalhd");
 	if (IS_ERR(crystalhd_class)) {
+		rc = PTR_ERR(crystalhd_class);
 		BCMLOG_ERR("failed to create class\n");
 		goto fail;
 	}
@@ -380,6 +381,7 @@ static int __devinit chd_dec_init_chdev(struct crystalhd_adp *adp)
 	dev = device_create(crystalhd_class, NULL, MKDEV(adp->chd_dec_major, 0),
 			    NULL, "crystalhd");
 	if (IS_ERR(dev)) {
+		rc = PTR_ERR(crystalhd_class);
 		BCMLOG_ERR("failed to create device\n");
 		goto device_create_fail;
 	}
-- 
1.7.9.5

--
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