2016-10-19 14:24:44

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] 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")
Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/staging/greybus/es2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c
index 8eabc71..a97fccf 100644
--- a/drivers/staging/greybus/es2.c
+++ b/drivers/staging/greybus/es2.c
@@ -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);


2016-10-19 15:45:07

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH -next] greybus: es2: fix error return code in ap_probe()

On Wed, Oct 19, 2016 at 01:17:53PM +0000, Wei Yongjun wrote:
> 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")
> 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.

Reviewed-by: Johan Hovold <[email protected]>

Thanks,
Johan

2016-10-19 15:50:54

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH -next] greybus: es2: fix error return code in ap_probe()

On Wed, Oct 19, 2016 at 6:47 PM, Wei Yongjun <[email protected]> wrote:
> 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")
> Signed-off-by: Wei Yongjun <[email protected]>
> ---
> drivers/staging/greybus/es2.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c
> index 8eabc71..a97fccf 100644
> --- a/drivers/staging/greybus/es2.c
> +++ b/drivers/staging/greybus/es2.c
> @@ -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);

Acked-by: Viresh Kumar <[email protected]>