From a530a8be395ff2df384ca729013890f3f040cf99 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 13 Apr 2016 19:19:00 +0200 Subject: [PATCH] greybus: interface: disable interface on registration failures Disable and deactivate an interface immediately on registration failures. Signed-off-by: Johan Hovold Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/svc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c index b79d81717360..5a16ad33b74b 100644 --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@ -518,7 +518,12 @@ static void gb_svc_process_intf_hotplug(struct gb_operation *operation) goto err_interface_deactivate; } - gb_interface_add(intf); + ret = gb_interface_add(intf); + if (ret) { + gb_interface_disable(intf); + gb_interface_deactivate(intf); + return; + } return; -- 2.20.1