mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] staging/crystalhd: assign PTR_ERR at fail cases to rc in chd_dec_init_chdev
@ 2012-08-05 21:13 Devendra Naga
  0 siblings, 0 replies; only message in thread
From: Devendra Naga @ 2012-08-05 21:13 UTC (permalink / raw)
  To: devel, linux-kernel
  Cc: Naren Sankar, Jarod Wilson, Scott Davilla, Manu Abraham,
	Greg Kroah-Hartman, Jorgyano Vieira, Devendra Naga

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@gmail.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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-08-05 21:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-05 21:13 [PATCH 1/2] staging/crystalhd: assign PTR_ERR at fail cases to rc in chd_dec_init_chdev Devendra Naga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®