Commit 80134da9 authored by Benoit Goby's avatar Benoit Goby Committed by Greg Kroah-Hartman

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: default avatarBenoit Goby <benoit@android.com>
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 036e98b2
...@@ -820,6 +820,7 @@ rndis_unbind(struct usb_configuration *c, struct usb_function *f) ...@@ -820,6 +820,7 @@ rndis_unbind(struct usb_configuration *c, struct usb_function *f)
rndis_deregister(rndis->config); rndis_deregister(rndis->config);
rndis_exit(); rndis_exit();
rndis_string_defs[0].id = 0;
if (gadget_is_superspeed(c->cdev->gadget)) if (gadget_is_superspeed(c->cdev->gadget))
usb_free_descriptors(f->ss_descriptors); usb_free_descriptors(f->ss_descriptors);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment