From 80134da9d244eddbc840a446bdda2ac80932a769 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Thu, 10 May 2012 10:08:03 +0200 Subject: [PATCH] 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 Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Kyungmin Park Acked-by: Michal Nazarewicz Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/f_rndis.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 52343654f5df..241225a37649 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) rndis_deregister(rndis->config); rndis_exit(); + rndis_string_defs[0].id = 0; if (gadget_is_superspeed(c->cdev->gadget)) usb_free_descriptors(f->ss_descriptors); -- 2.20.1