Skip to contentSkip to conversation

wavelan: check request_region return value

PATCH Jean Tourrilhes 1 participant 1 message Jan 9, 2002 1 message not in the archive Network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · Steven Walter

I recently changed several drivers in drivers/net of the Linux kernel to correctly check the return value of request_region. Since you appear to be the maintainer of this driver, I'm forwarding the patch to you.

Thanks

Signature · 1 line
-Steven

For some reason, the tab got mangled, so I redid the
patch. Ready to go in kernel 2.4.X and 2.5.X.

Jean

drivers/net/wavelan.c renamed from drivers/net/wavelan.j1.c +2 -1
diff -u -p linux/drivers/net/wavelan.j1.c linux/drivers/net/wavelan.c
@@ -4019,7 +4019,8 @@ static int __init wavelan_config(device 
 
 	dev->irq = irq;
 
-	request_region(ioaddr, sizeof(ha_t), "wavelan");
+	if (!request_region(ioaddr, sizeof(ha_t), "wavelan"))
+		return -EBUSY;
 
 	dev->mem_start = 0x0000;
 	dev->mem_end = 0x0000;