summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavitrakumar Managutte <pavitra1729@gmail.com>2014-10-22 16:03:22 +0200
committerFelipe Balbi <balbi@ti.com>2014-10-23 21:49:35 +0200
commit9b1763553a89b2a84881119eeabfccdb803bb468 (patch)
treeb963040d5e02eadb9546a6caee16ea02cec2579e
parentusb: dwc2: gadget: disable phy before turning off power regulators (diff)
downloadlinux-9b1763553a89b2a84881119eeabfccdb803bb468.tar.xz
linux-9b1763553a89b2a84881119eeabfccdb803bb468.zip
usb: gadget: function: Fixed the return value on error path
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. Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Pavitrakumar Managutte <pavitra1729@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/function/f_rndis.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c
index 2f0517f5bae3..f13fc6a58565 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_free_descs;
+ }
/* NOTE: all that is done without knowing or caring about
* the network link ... which is unavailable to this code