From 8ea6c4e694a080b8c4eca00867f83ff8e709aafa Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Thu, 9 Sep 1999 06:30:37 +0000 Subject: 1999-09-09 Thomas Bushnell, BSG * linux/src/drivers/net/rtl8139.c (RX_BUF_LEN_IDX): Reduce from 3 to 2. (64K exceeds the limits in linux/dev/glue/kmem.c:kmalloc.) (rtl8129_open): If we fail to get the memory we need, then free the IRQ before returning. Reported by Daniel Kobras . --- linux/src/drivers/net/rtl8139.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux/src/drivers') diff --git a/linux/src/drivers/net/rtl8139.c b/linux/src/drivers/net/rtl8139.c index b5c355b..0bd11a5 100644 --- a/linux/src/drivers/net/rtl8139.c +++ b/linux/src/drivers/net/rtl8139.c @@ -27,7 +27,7 @@ static const char *version = static int max_interrupt_work = 10; /* Size of the in-memory receive ring. */ -#define RX_BUF_LEN_IDX 3 /* 0==8K, 1==16K, 2==32K, 3==64K */ +#define RX_BUF_LEN_IDX 2 /* 0==8K, 1==16K, 2==32K, 3==64K */ #define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX) /* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */ #define TX_BUF_SIZE 1536 @@ -614,6 +614,7 @@ rtl8129_open(struct device *dev) tp->tx_bufs = kmalloc(TX_BUF_SIZE * NUM_TX_DESC, GFP_KERNEL); tp->rx_ring = kmalloc(RX_BUF_LEN + 16, GFP_KERNEL); if (tp->tx_bufs == NULL || tp->rx_ring == NULL) { + free_irq (dev->irq, dev); if (tp->tx_bufs) kfree(tp->tx_bufs); if (rtl8129_debug > 0) -- cgit v1.2.3