Skip to content

Commit

Permalink
greybus: svc: fix an error handling bug in gb_svc_hello()
Browse files Browse the repository at this point in the history
Cleanup if gb_svc_queue_deferred_request() fails.

Link: https://lore.kernel.org/r/20220202072016.GA6748@kili
Fixes: ee2f207 ("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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Feb 4, 2022
1 parent 7ab004d commit 5f8583a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/greybus/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5f8583a

Please sign in to comment.