From bdad8743fb2c866e7dda5f8b903415046401ab4d Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Fri, 20 Jan 2012 14:42:41 -0800 Subject: usb: gadget: Fix usb string id allocation Don't reset next_string_id every time the gadget is enabled, this makes the next strings allocated overwrite strings allocated at probe time. Instead, fix rndis not to allocate new string ids on every config bind. Change-Id: Ied28ee416bb6f00c434c34176fe5b7f0dcb2b2d4 Signed-off-by: Benoit Goby --- drivers/usb/gadget/f_rndis.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/usb/gadget/f_rndis.c') diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 36e8c44d8e5..21c5ee2482d 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c @@ -821,12 +821,12 @@ rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], if (!can_support_rndis(c) || !ethaddr) return -EINVAL; - if (rndis_string_defs[0].id == 0) { - /* ... and setup RNDIS itself */ - status = rndis_init(); - if (status < 0) - return status; + /* setup RNDIS itself */ + status = rndis_init(); + if (status < 0) + return status; + if (rndis_string_defs[0].id == 0) { status = usb_string_ids_tab(c->cdev, rndis_string_defs); if (status) return status; -- cgit v1.2.3