summaryrefslogtreecommitdiff
path: root/drivers/greybus
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-02-02 14:33:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 15:22:50 +0300
commitab67122003b15c7f6dd458d13f6a6e1342ee2811 (patch)
treec8be4060f35c64bf7f4cca958e54eeb348262f92 /drivers/greybus
parent9e97f6641c878bc7ce7f4eac835142a7e9d07c11 (diff)
downloadlinux-ab67122003b15c7f6dd458d13f6a6e1342ee2811.tar.xz
greybus: svc: fix an error handling bug in gb_svc_hello()
commit 5f8583a3b7552092582a92e7bbd2153319929ad7 upstream. Cleanup if gb_svc_queue_deferred_request() fails. Link: https://lore.kernel.org/r/20220202072016.GA6748@kili Fixes: ee2f2074fdb2 ("greybus: svc: reconfig APBridgeA-Switch link to handle required load") Cc: stable@vger.kernel.org # 4.9 [johan: fix commit summary prefix and rename label ] Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20220202113347.1288-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/greybus')
-rw-r--r--drivers/greybus/svc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/greybus/svc.c b/drivers/greybus/svc.c
index ce7740ef449b..51d0875a3480 100644
--- a/drivers/greybus/svc.c
+++ b/drivers/greybus/svc.c
@@ -866,8 +866,14 @@ static int gb_svc_hello(struct gb_operation *op)
gb_svc_debugfs_init(svc);
- return gb_svc_queue_deferred_request(op);
+ ret = gb_svc_queue_deferred_request(op);
+ if (ret)
+ goto err_remove_debugfs;
+
+ return 0;
+err_remove_debugfs:
+ gb_svc_debugfs_exit(svc);
err_unregister_device:
gb_svc_watchdog_destroy(svc);
device_del(&svc->dev);