Skip to content

Commit

Permalink
usb: gadget: rndis: Fix re-binding f_rndis
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benoit Goby authored and Greg Kroah-Hartman committed May 10, 2012
1 parent 036e98b commit 80134da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/gadget/f_rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 80134da

Please sign in to comment.