From: Chuhong Yuan <hslester96@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Ian Abbott <abbotti@mev.co.uk>,
H Hartley Sweeten <hsweeten@visionengravers.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Cheah Kok Cheong <thrust73@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Chuhong Yuan <hslester96@gmail.com>
Subject: [PATCH] staging: comedi: comedi_test: return error when comedi_test_init fails
Date: Tue, 10 Dec 2019 17:14:51 +0800 [thread overview]
Message-ID: <20191210091451.23505-1-hslester96@gmail.com> (raw)
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@gmail.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
next reply other threads:[~2019-12-10 9:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 9:14 Chuhong Yuan [this message]
2019-12-10 10:58 ` Ian Abbott
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=20191210091451.23505-1-hslester96@gmail.com \
--to=hslester96@gmail.com \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thrust73@gmail.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®