[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1344201296-16995-1-git-send-email-develkernel412222@gmail.com>
Date: Mon, 6 Aug 2012 02:59:56 +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 2/2] 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@...il.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
--
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