aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Goby <benoit@android.com>2012-05-10 04:08:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-10 15:26:47 -0400
commit80134da9d244eddbc840a446bdda2ac80932a769 (patch)
tree41a88f034565c29ac6e511aa96bfa2118089d473
parent036e98b2162d1ed361ed6d31ab009764bb507340 (diff)
usb: gadget: rndis: Fix re-binding f_rndis
f_rndis checks if rndis_string_defs[0].id is null to setup rndis and allocate string ids when it is bound to the first configuration: /* maybe allocate device-global string IDs */ if (rndis_string_defs[0].id == 0) { /* ... and setup RNDIS itself */ status = rndis_init(); if (status < 0) return status; rndis_string_defs[0].id must be reset to 0 on unbind for rndis to be correctly initialized on the next composite_bind. Signed-off-by: Benoit Goby <benoit@android.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/gadget/f_rndis.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index 52343654f5d..241225a3764 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -820,6 +820,7 @@ rndis_unbind(struct usb_configuration *c, struct usb_function *f)
820 820
821 rndis_deregister(rndis->config); 821 rndis_deregister(rndis->config);
822 rndis_exit(); 822 rndis_exit();
823 rndis_string_defs[0].id = 0;
823 824
824 if (gadget_is_superspeed(c->cdev->gadget)) 825 if (gadget_is_superspeed(c->cdev->gadget))
825 usb_free_descriptors(f->ss_descriptors); 826 usb_free_descriptors(f->ss_descriptors);