Skip to contentSkip to conversation

i82596/CONFIG_APRICOT release_region() fix

PATCH New Magnus Damm 1 participant 1 message Nov 30, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i82596/CONFIG_APRICOT release_region() fix

Fix release_region() in i82596 driver using CONFIG_APRICOT.

linux-2.6.15-rc3 configured with CONFIG_APRICOT=y calls release_region() incorrectly if no hardware is found:

Trying to free nonexistent resource <00000000-00000010>

This patch sets up dev->base_addr before the label "out1" might be used.

---

 82596.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/82596.c +3 -2
@@ -1203,6 +1203,9 @@
 			checksum += eth_addr[i];
 		}
 
+		dev->base_addr = ioaddr;
+		dev->irq = 10;
+
 		/* checksum is a multiple of 0x100, got this wrong first time
 		   some machines have 0x100, some 0x200. The DOS driver doesn't
 		   even bother with the checksum.
@@ -1215,8 +1218,6 @@
 			goto out1;
 		}
 
-		dev->base_addr = ioaddr;
-		dev->irq = 10;
 	}
 #endif
 	dev->mem_start = (int)__get_free_pages(GFP_ATOMIC, 0);