From david-b@pacbell.net Tue May 24 18:01:30 2005 From: David Brownell Subject: USB gadget: drain rndis response queue on disconnect Date: Tue, 24 May 2005 17:51:52 -0700 To: "Andy Lowe" , Greg KH Message-Id: <200505241751.52227.david-b@pacbell.net> 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: Andy Lowe Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/rndis.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/usb/gadget/rndis.c 2005-05-27 20:53:06.000000000 -0700 +++ gregkh-2.6/drivers/usb/gadget/rndis.c 2005-05-27 21:03:50.000000000 -0700 @@ -1025,11 +1025,17 @@ void rndis_uninit (int configNr) { + u8 *buf; + u32 length; + if (configNr >= RNDIS_MAX_CONFIGS) return; rndis_per_dev_params [configNr].used = 0; 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)