summaryrefslogtreecommitdiff
path: root/debian/patches/80_rtl8139_open.patch
blob: f4b937635ef8a2b7ddc50d40a4a37374c5e4b370 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Fix 8138 initialization division by zero.

Index: linux/src/drivers/net/rtl8139.c
===================================================================
RCS file: /cvsroot/hurd/gnumach/linux/src/drivers/net/Attic/rtl8139.c,v
retrieving revision 1.2.4.2
retrieving revision 1.2.4.1
diff -u -p -r1.2.4.2 -r1.2.4.1
--- linux/src/drivers/net/rtl8139.c	4 Jul 2008 10:04:17 -0000	1.2.4.2
+++ linux/src/drivers/net/rtl8139.c	22 Jan 2006 15:54:41 -0000	1.2.4.1
@@ -705,6 +705,10 @@ static int rtl8129_open(struct net_devic
 	int rx_buf_len_idx;
 
 	MOD_INC_USE_COUNT;
+	if (request_irq(dev->irq, &rtl8129_interrupt, SA_SHIRQ, dev->name, dev)) {
+		MOD_DEC_USE_COUNT;
+		return -EAGAIN;
+	}
 
 	/* The Rx ring allocation size is 2^N + delta, which is worst-case for
 	   the kernel binary-buddy allocation.  We allocate the Tx bounce buffers
@@ -733,11 +737,6 @@ static int rtl8129_open(struct net_devic
 	tp->rx_config =
 		(RX_FIFO_THRESH << 13) | (rx_buf_len_idx << 11) | (RX_DMA_BURST<<8);
 
-	if (request_irq(dev->irq, &rtl8129_interrupt, SA_SHIRQ, dev->name, dev)) {
-		MOD_DEC_USE_COUNT;
-		return -EAGAIN;
-	}
-
 	rtl_hw_start(dev);
 	netif_start_tx_queue(dev);