<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff -Nru a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
--- a/drivers/net/irda/irda-usb.c	Tue Mar  5 10:58:16 2002
+++ b/drivers/net/irda/irda-usb.c	Tue Mar  5 10:58:16 2002
@@ -255,7 +255,7 @@
 		   self-&gt;new_speed, self-&gt;new_xbofs);
 
 	/* Grab the speed URB */
-	urb = &amp;self-&gt;speed_urb;
+	urb = self-&gt;speed_urb;
 	if (urb-&gt;status != 0) {
 		WARNING(__FUNCTION__ "(), URB still in use!\n");
 		return;
@@ -317,7 +317,7 @@
 	urb-&gt;status = 0;
 
 	/* If it was the speed URB, allow the stack to send more packets */
-	if(urb == &amp;self-&gt;speed_urb) {
+	if(urb == self-&gt;speed_urb) {
 		netif_wake_queue(self-&gt;netdev);
 	}
 }
@@ -329,7 +329,7 @@
 static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
 {
 	struct irda_usb_cb *self = netdev-&gt;priv;
-	struct urb *urb = &amp;self-&gt;tx_urb;
+	struct urb *urb = self-&gt;tx_urb;
 	unsigned long flags;
 	s32 speed;
 	s16 xbofs;
@@ -546,7 +546,7 @@
 	}
 
 	/* Check speed URB */
-	urb = &amp;(self-&gt;speed_urb);
+	urb = self-&gt;speed_urb;
 	if (urb-&gt;status != 0) {
 		IRDA_DEBUG(0, "%s: Speed change timed out, urb-&gt;status=%d, urb-&gt;transfer_flags=0x%04X\n", netdev-&gt;name, urb-&gt;status, urb-&gt;transfer_flags);
 
@@ -571,7 +571,7 @@
 	}
 
 	/* Check Tx URB */
-	urb = &amp;(self-&gt;tx_urb);
+	urb = self-&gt;tx_urb;
 	if (urb-&gt;status != 0) {
 		struct sk_buff *skb = urb-&gt;context;
 
@@ -955,9 +955,9 @@
 	/* Now that we can pass data to IrLAP, allow the USB layer
 	 * to send us some data... */
 	for (i = 0; i &lt; IU_MAX_ACTIVE_RX_URBS; i++)
-		irda_usb_submit(self, NULL, &amp;(self-&gt;rx_urb[i]));
+		irda_usb_submit(self, NULL, self-&gt;rx_urb[i]);
 	/* Note : we submit all the Rx URB except for one - Jean II */
-	self-&gt;idle_rx_urb = &amp;(self-&gt;rx_urb[IU_MAX_ACTIVE_RX_URBS]);
+	self-&gt;idle_rx_urb = self-&gt;rx_urb[IU_MAX_ACTIVE_RX_URBS];
 	self-&gt;idle_rx_urb-&gt;context = NULL;
 
 	/* Ready to play !!! */
@@ -992,7 +992,7 @@
 
 	/* Deallocate all the Rx path buffers (URBs and skb) */
 	for (i = 0; i &lt; IU_MAX_RX_URBS; i++) {
-		struct urb *urb = &amp;(self-&gt;rx_urb[i]);
+		struct urb *urb = self-&gt;rx_urb[i];
 		struct sk_buff *skb = (struct sk_buff *) urb-&gt;context;
 		/* Cancel the receive command */
 		usb_unlink_urb(urb);
@@ -1003,8 +1003,8 @@
 		}
 	}
 	/* Cancel Tx and speed URB */
-	usb_unlink_urb(&amp;(self-&gt;tx_urb));
-	usb_unlink_urb(&amp;(self-&gt;speed_urb));
+	usb_unlink_urb(self-&gt;tx_urb);
+	usb_unlink_urb(self-&gt;speed_urb);
 
 	/* Stop and remove instance of IrLAP */
 	if (self-&gt;irlap)
@@ -1429,7 +1429,31 @@
 	self-&gt;present = 0;
 	self-&gt;netopen = 0;
 
-       /* Is this really necessary? */
+	/* Create all of the needed urbs */
+	for (i = 0; i &lt; IU_MAX_RX_URBS; i++) {
+		self-&gt;rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
+		if (!self-&gt;rx_urb[i]) {
+			int j;
+			for (j = 0; j &lt; i; j++)
+				usb_free_urb(self-&gt;rx_urb[j]);
+			return NULL;
+		}
+	}
+	self-&gt;tx_urb = usb_alloc_urb(0, GFP_KERNEL);
+	if (!self-&gt;tx_urb) {
+		for (i = 0; i &lt; IU_MAX_RX_URBS; i++)
+			usb_free_urb(self-&gt;rx_urb[i]);
+		return NULL;
+	}
+	self-&gt;speed_urb = usb_alloc_urb(0, GFP_KERNEL);
+	if (!self-&gt;speed_urb) {
+		for (i = 0; i &lt; IU_MAX_RX_URBS; i++)
+			usb_free_urb(self-&gt;rx_urb[i]);
+		usb_free_urb(self-&gt;tx_urb);
+		return NULL;
+	}
+
+	/* Is this really necessary? */
 	if (usb_set_configuration (dev, dev-&gt;config[0].bConfigurationValue) &lt; 0) {
 		err("set_configuration failed");
 		return NULL;
@@ -1501,10 +1525,10 @@
 		netif_stop_queue(self-&gt;netdev);
 		/* Stop all the receive URBs */
 		for (i = 0; i &lt; IU_MAX_RX_URBS; i++)
-			usb_unlink_urb(&amp;(self-&gt;rx_urb[i]));
+			usb_unlink_urb(self-&gt;rx_urb[i]);
 		/* Cancel Tx and speed URB */
-		usb_unlink_urb(&amp;(self-&gt;tx_urb));
-		usb_unlink_urb(&amp;(self-&gt;speed_urb));
+		usb_unlink_urb(self-&gt;tx_urb);
+		usb_unlink_urb(self-&gt;speed_urb);
 
 		IRDA_DEBUG(0, __FUNCTION__ "(), postponing disconnect, network is still active...\n");
 		/* better not do anything just yet, usb_irda_cleanup()
@@ -1516,6 +1540,14 @@
 	irda_usb_close(self);
 	/* No longer attached to USB bus */
 	self-&gt;usbdev = NULL;
+
+	/* Clean up our urbs */
+	for (i = 0; i &lt; IU_MAX_RX_URBS; i++)
+		usb_free_urb(self-&gt;rx_urb[i]);
+	/* Cancel Tx and speed URB */
+	usb_free_urb(self-&gt;tx_urb);
+	usb_free_urb(self-&gt;speed_urb);
+
 	IRDA_DEBUG(0, __FUNCTION__ "(), USB IrDA Disconnected\n");
 }
 
diff -Nru a/include/net/irda/irda-usb.h b/include/net/irda/irda-usb.h
--- a/include/net/irda/irda-usb.h	Tue Mar  5 10:58:16 2002
+++ b/include/net/irda/irda-usb.h	Tue Mar  5 10:58:16 2002
@@ -139,10 +139,10 @@
 
 	wait_queue_head_t wait_q;	/* for timeouts */
 
-	struct urb rx_urb[IU_MAX_RX_URBS];	/* URBs used to receive data frames */
+	struct urb *rx_urb[IU_MAX_RX_URBS];	/* URBs used to receive data frames */
 	struct urb *idle_rx_urb;	/* Pointer to idle URB in Rx path */
-	struct urb tx_urb;		/* URB used to send data frames */
-	struct urb speed_urb;		/* URB used to send speed commands */
+	struct urb *tx_urb;		/* URB used to send data frames */
+	struct urb *speed_urb;		/* URB used to send speed commands */
 	
 	struct net_device *netdev;	/* Yes! we are some kind of netdev. */
 	struct net_device_stats stats;
</pre></body></html>