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 2/2] staging/crystalhd: unregister chardev when class_create fails in chd_dec_init_chdev
Date: Mon, 6 Aug 2012 02:59:56 +0545 [thread overview]
Message-ID: <1344201296-16995-1-git-send-email-develkernel412222@gmail.com> (raw)
we missed a unregiser_chrdev if the class_create and subsequent function calls / checks fail
Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
---
drivers/staging/crystalhd/crystalhd_lnx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 0582ac0..5909d8d 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -375,7 +375,7 @@ static int __devinit chd_dec_init_chdev(struct crystalhd_adp *adp)
if (IS_ERR(crystalhd_class)) {
rc = PTR_ERR(crystalhd_class);
BCMLOG_ERR("failed to create class\n");
- goto fail;
+ goto class_create_fail;
}
dev = device_create(crystalhd_class, NULL, MKDEV(adp->chd_dec_major, 0),
@@ -412,6 +412,8 @@ elem_pool_fail:
device_destroy(crystalhd_class, MKDEV(adp->chd_dec_major, 0));
device_create_fail:
class_destroy(crystalhd_class);
+class_create_fail:
+ unregister_chrdev(adp->chd_dec_major, CRYSTALHD_API_NAME);
fail:
return rc;
}
--
1.7.9.5
reply other threads:[~2012-08-05 21:15 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=1344201296-16995-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®