On Monday 23 May 2005 3:11 pm, Andy Lowe wrote:
> This patch should apply to the current version of rndis.c in the gadget-2.6 
> bk tree.
> 
> - Andy Lowe <[EMAIL PROTECTED]>

Looks fair to me; good catch, thanks.

That BK tree isn't being kept particularly current now that everything's
on GIT.  It's going to vanish.

However this patch will apply against the latest MM tree code, or Greg's
current USB patches -- though not against 2.6.12-rc4.  Greg, please merge
this version (which I re-genned).

- Dave



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 <[EMAIL PROTECTED]>
Signed-off-by: David Brownell <[EMAIL PROTECTED]>

--- g26.orig/drivers/usb/gadget/rndis.c	2005-05-21 20:46:36.000000000 -0700
+++ g26/drivers/usb/gadget/rndis.c	2005-05-24 17:44:24.000000000 -0700
@@ -1025,11 +1025,17 @@ int rndis_signal_disconnect (int configN
 
 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)

Reply via email to