[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191210091451.23505-1-hslester96@gmail.com>
Date: Tue, 10 Dec 2019 17:14:51 +0800
From: Chuhong Yuan <hslester96@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Ian Abbott <abbotti@....co.uk>,
H Hartley Sweeten <hsweeten@...ionengravers.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Cheah Kok Cheong <thrust73@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH] staging: comedi: comedi_test: return error when comedi_test_init fails
comedi_test_init() forgets to return error when it fails.
Modify the return value to fix it.
Fixes: 9ff7400bd38c ("Staging: comedi: drivers: comedi_test: Add auto-configuration capability")
Signed-off-by: Chuhong Yuan <hslester96@...il.com>
---
drivers/staging/comedi/drivers/comedi_test.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c
index ef4c7c8a2b71..133ed99a89f1 100644
--- a/drivers/staging/comedi/drivers/comedi_test.c
+++ b/drivers/staging/comedi/drivers/comedi_test.c
@@ -799,12 +799,14 @@ static int __init comedi_test_init(void)
if (!config_mode) {
ctcls = class_create(THIS_MODULE, CLASS_NAME);
if (IS_ERR(ctcls)) {
+ ret = PTR_ERR(ctcls);
pr_warn("comedi_test: unable to create class\n");
goto clean3;
}
ctdev = device_create(ctcls, NULL, MKDEV(0, 0), NULL, DEV_NAME);
if (IS_ERR(ctdev)) {
+ ret = PTR_ERR(ctdev);
pr_warn("comedi_test: unable to create device\n");
goto clean2;
}
@@ -826,7 +828,7 @@ static int __init comedi_test_init(void)
clean3:
ctcls = NULL;
- return 0;
+ return ret;
}
module_init(comedi_test_init);
--
2.24.0
Powered by blists - more mailing lists