mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Devendra Naga <develkernel412222@gmail.com>
To: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Naren Sankar <nsankar@broadcom.com>,
	Jarod Wilson <jarod@wilsonet.com>,
	Scott Davilla <davilla@4pi.com>,
	Manu Abraham <abraham.manu@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jorgyano Vieira <jorgyano@gmail.com>,
	Devendra Naga <develkernel412222@gmail.com>
Subject: [PATCH 1/2] staging/crystalhd: assign PTR_ERR at fail cases to rc in chd_dec_init_chdev
Date: Mon,  6 Aug 2012 02:58:47 +0545	[thread overview]
Message-ID: <1344201227-16912-1-git-send-email-develkernel412222@gmail.com> (raw)

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


                 reply	other threads:[~2012-08-05 21:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344201227-16912-1-git-send-email-develkernel412222@gmail.com \
    --to=develkernel412222@gmail.com \
    --cc=abraham.manu@gmail.com \
    --cc=davilla@4pi.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jarod@wilsonet.com \
    --cc=jorgyano@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsankar@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®