* [PATCH -next] greybus: es2: fix error return code in ap_probe()
@ 2016-10-19 13:17 Wei Yongjun
2016-10-19 13:30 ` Johan Hovold
2016-10-19 14:07 ` Viresh Kumar
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2016-10-19 13:17 UTC (permalink / raw)
To: Johan Hovold, Alex Elder, Alexandre Bailon, Greg Kroah-Hartman
Cc: Wei Yongjun, devel, linux-kernel
From: Wei Yongjun <weiyongjun1@huawei.com>
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 <weiyongjun1@huawei.com>
---
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);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] greybus: es2: fix error return code in ap_probe()
2016-10-19 13:17 [PATCH -next] greybus: es2: fix error return code in ap_probe() Wei Yongjun
@ 2016-10-19 13:30 ` Johan Hovold
2016-10-19 14:07 ` Viresh Kumar
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2016-10-19 13:30 UTC (permalink / raw)
To: Wei Yongjun
Cc: Johan Hovold, Alex Elder, Alexandre Bailon, Greg Kroah-Hartman,
Wei Yongjun, devel, linux-kernel
On Wed, Oct 19, 2016 at 01:17:53PM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> 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 <weiyongjun1@huawei.com>
Thanks for the fix. This was clearly broken and would have led to
havoc on disconnect as well.
Reviewed-by: Johan Hovold <johan@kernel.org>
Thanks,
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] greybus: es2: fix error return code in ap_probe()
2016-10-19 13:17 [PATCH -next] greybus: es2: fix error return code in ap_probe() Wei Yongjun
2016-10-19 13:30 ` Johan Hovold
@ 2016-10-19 14:07 ` Viresh Kumar
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2016-10-19 14:07 UTC (permalink / raw)
To: Wei Yongjun
Cc: Johan Hovold, Alex Elder, Alexandre Bailon, Greg Kroah-Hartman,
driver-dev, Wei Yongjun, linux-kernel@vger.kernel.org
On Wed, Oct 19, 2016 at 6:47 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> 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 <weiyongjun1@huawei.com>
> ---
> 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 <viresh.kumar@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-19 15:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-19 13:17 [PATCH -next] greybus: es2: fix error return code in ap_probe() Wei Yongjun
2016-10-19 13:30 ` Johan Hovold
2016-10-19 14:07 ` Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox