greybus: es2: fix error return code in ap_probe()
PATCH 1/1 greybus: es2: fix error return code in ap_probe()
From: Wei Yongjun <[email protected]>
Fix to return a negative error code from the es2_arpc_in_enable() error handling case instead of 0, as done elsewhere in this function.
APBridgeA RPC")
--- drivers/staging/greybus/es2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/greybus/es2.c +2 -1
@@ -1547,7 +1547,8 @@ static int ap_probe(struct usb_interface *interface,INIT_LIST_HEAD (&es2->arpcs);spin_lock_init (&es2->arpc_lock); -if (es2_arpc_in_enable (es2)) + retval =es2_arpc_in_enable (es2); +if (retval) goto error; retval =gb_hd_add (hd);
Quoted 8 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
Fix to return a negative error code from the
es2_arpc_in_enable()error handling case instead of 0, as done elsewhere in this function.Fixes 9d9d3777a9db ("greybus: es2: Add a new bulk in endpoint forAPBridgeA RPC")
Signed-off-by Wei Yongjun <[email protected]>
Thanks for the fix. This was clearly broken and would have led to havoc on disconnect as well.
Thanks,
Johan
Quoted 17 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
Fix to return a negative error code from the
es2_arpc_in_enable()error handling case instead of 0, as done elsewhere in this function.Fixes 9d9d3777a9db ("greybus: es2: Add a new bulk in endpoint forAPBridgeA RPC")
Signed-off-by Wei Yongjun <[email protected]>--- drivers/staging/greybus/es2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/greybus/es2.c +0
-0
drivers/staging/greybus/es2.c static int ap_probe(struct usb_interface *interface, · line 1554
Quoted 9 lines
drivers/staging/greybus/es2.c +2
-1@@ -1547,7 +1547,8 @@ static int ap_probe(struct usb_interface *interface,INIT_LIST_HEAD (&es2->arpcs);spin_lock_init (&es2->arpc_lock); -if (es2_arpc_in_enable (es2)) + retval =es2_arpc_in_enable (es2); +if (retval) goto error; retval =gb_hd_add (hd);