Skip to contentSkip to conversation

greybus: es2: fix error return code in ap_probe()

PATCH In review Wei Yongjun 3 participants 3 messages Oct 19, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Fixes 9d9d3777a9db ("greybus: es2: Add a new bulk in endpoint for

APBridgeA RPC")

---
 drivers/staging/greybus/es2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/greybus/es2.c +2 -1
index 8eabc71..a97fccf 100644
@@ -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);
maintainer Reviewed-by on v1 1/1
#1 lore raw
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 for

APBridgeA RPC")

Thanks for the fix. This was clearly broken and would have led to havoc on disconnect as well.

Thanks,
Johan

Acked-by on v1 1/1
#2 lore raw
In reply to Wei Yongjun
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 for

APBridgeA RPC")

---
 drivers/staging/greybus/es2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/greybus/es2.c +0 -0
index 8eabc71..a97fccf 100644

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);