From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
Mitchell Tasman <tasman@leaflabs.com>,
Dan Carpenter <dan.carpenter@oracle.com>,
greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] greybus: svc: clean up hello error path
Date: Wed, 2 Feb 2022 12:33:46 +0100 [thread overview]
Message-ID: <20220202113347.1288-3-johan@kernel.org> (raw)
In-Reply-To: <20220202113347.1288-1-johan@kernel.org>
While currently safe, it is unnecessary (and confusing) to try to
destroy the watchdog when watchdog creation fails.
Change the corresponding error path to only deregister the svc.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/greybus/svc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/greybus/svc.c b/drivers/greybus/svc.c
index 51d0875a3480..4f93d6b2f4ed 100644
--- a/drivers/greybus/svc.c
+++ b/drivers/greybus/svc.c
@@ -861,7 +861,7 @@ static int gb_svc_hello(struct gb_operation *op)
ret = gb_svc_watchdog_create(svc);
if (ret) {
dev_err(&svc->dev, "failed to create watchdog: %d\n", ret);
- goto err_unregister_device;
+ goto err_deregister_svc;
}
gb_svc_debugfs_init(svc);
@@ -874,9 +874,10 @@ static int gb_svc_hello(struct gb_operation *op)
err_remove_debugfs:
gb_svc_debugfs_exit(svc);
-err_unregister_device:
gb_svc_watchdog_destroy(svc);
+err_deregister_svc:
device_del(&svc->dev);
+
return ret;
}
--
2.34.1
next prev parent reply other threads:[~2022-02-02 11:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-02 11:33 [PATCH 0/3] greybus: svc: fix hello processing Johan Hovold
2022-02-02 11:33 ` [PATCH 1/3] greybus: svc: fix an error handling bug in gb_svc_hello() Johan Hovold
2022-02-02 11:33 ` Johan Hovold [this message]
2022-02-02 11:33 ` [PATCH 3/3] greybus: svc: clean up link configuration hack at hello Johan Hovold
2022-02-02 11:48 ` [PATCH 0/3] greybus: svc: fix hello processing Dan Carpenter
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=20220202113347.1288-3-johan@kernel.org \
--to=johan@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tasman@leaflabs.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