Discussion:
[PATCH] usb: gadget: function: Fixed the return value on error path
(too old to reply)
Pavitrakumar Managutte
2014-10-22 14:03:22 UTC
Permalink
Raw Message
Fixed the return value on failure. status variable
is set to 0 at usb_assign_descriptors call and the same is
returned on error which is incorrect.

Signed-off-by: Pavitrakumar Managutte <pavitra1729-***@public.gmane.org>
---
drivers/usb/gadget/function/f_rndis.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c
index ddb09dc..0cd2aba 100644
--- a/drivers/usb/gadget/function/f_rndis.c
+++ b/drivers/usb/gadget/function/f_rndis.c
@@ -802,8 +802,10 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)

if (rndis->manufacturer && rndis->vendorID &&
rndis_set_param_vendor(rndis->config, rndis->vendorID,
- rndis->manufacturer))
+ rndis->manufacturer)) {
+ status = -EINVAL;
goto fail;
+ }

/* NOTE: all that is done without knowing or caring about
* the network link ... which is unavailable to this code
--
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...