aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/crystalhd
diff options
context:
space:
mode:
authorDevendra Naga <develkernel412222@gmail.com>2012-08-06 02:59:56 +0545
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-13 19:15:49 -0700
commit675fe097568894708afd3b264e4122589e879f40 (patch)
tree57eaea209c099809a4c272fe7d18d3c57a41097c /drivers/staging/crystalhd
parent3b2f1fbec9218f24425eaaeedd4fd3e6ef3e9f44 (diff)
downloadlinaro-lsk-675fe097568894708afd3b264e4122589e879f40.tar.gz
staging/crystalhd: unregister chardev when class_create fails in chd_dec_init_chdev
we missed a unregiser_chrdev if the class_create and subsequent function calls / checks fail Signed-off-by: Devendra Naga <develkernel412222@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/crystalhd')
-rw-r--r--drivers/staging/crystalhd/crystalhd_lnx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 0582ac04b75..5909d8d1b4d 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;
}