提交 486e2df6 编写于 作者: D David Brownell 提交者: Greg Kroah-Hartman

[PATCH] USB gadget: drain rndis response queue on disconnect

Drain the rndis response queue on disconnect.  This fixes a problem
in which an rndis response left in the queue from a previous session
could cause a subsequent session to fail.
Signed-off-by: NAndy Lowe <alowe@mvista.com>
Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 45e45ab4
...@@ -1025,11 +1025,17 @@ int rndis_signal_disconnect (int configNr) ...@@ -1025,11 +1025,17 @@ int rndis_signal_disconnect (int configNr)
void rndis_uninit (int configNr) void rndis_uninit (int configNr)
{ {
u8 *buf;
u32 length;
if (configNr >= RNDIS_MAX_CONFIGS) if (configNr >= RNDIS_MAX_CONFIGS)
return; return;
rndis_per_dev_params [configNr].used = 0; rndis_per_dev_params [configNr].used = 0;
rndis_per_dev_params [configNr].state = RNDIS_UNINITIALIZED; rndis_per_dev_params [configNr].state = RNDIS_UNINITIALIZED;
return;
/* drain the response queue */
while ((buf = rndis_get_next_response(configNr, &length)))
rndis_free_response(configNr, buf);
} }
void rndis_set_host_mac (int configNr, const u8 *addr) void rndis_set_host_mac (int configNr, const u8 *addr)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册