aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/crystalhd
diff options
context:
space:
mode:
authorDevendra Naga <develkernel412222@gmail.com>2012-08-06 02:58:47 +0545
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-13 19:15:49 -0700
commit3b2f1fbec9218f24425eaaeedd4fd3e6ef3e9f44 (patch)
tree907f85da9d76fae660186e682f1e1d7bf1c70a24 /drivers/staging/crystalhd
parentcdf5e55124e4804fc0027df7e89567a3f5eed8bf (diff)
staging/crystalhd: assign PTR_ERR at fail cases to rc in chd_dec_init_chdev
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/crystalhd')
-rw-r--r--drivers/staging/crystalhd/crystalhd_lnx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index d9e3d618f7f..0582ac04b75 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;
}