[PATCH][2.2] eepro100 - gracefully handle init_etherdev failure

From: Neale Banks (neale@lowendale.com.au)
Date: Mon Jan 21 2002 - 08:44:01 EST


Greetings,

Appended patch against 2.2.21pre2 is for eepro100 to gracefully handle the
case where init_etherdev() returns NULL.

BTW, in testing this the unpatched eepro100 driver module apeared to get
wedged in an initialising status - is this normal?

Regards,
Neale.

--- linux-2.2.21-pre2-pristine/drivers/net/eepro100.c Mon Mar 26 02:37:34 2001
+++ linux-2.2.21-pre2-ntb/drivers/net/eepro100.c Mon Jan 21 21:40:38 2002
@@ -43,6 +43,8 @@
                 Changed command completion time and added debug info as to which
                 CMD timed out. Problem reported by:
                 "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
+ 2002 Jan 21 Neale Banks <neale@lowendale.com.au>
+ Gracefully handle the case where init_etherdev() returns NULL
 */
 
 /*#define USE_IO*/
@@ -698,6 +700,11 @@
 #endif
 
         dev = init_etherdev(NULL, sizeof(struct speedo_private));
+
+ if (dev == NULL) {
+ printk(KERN_ERR "eepro100: Unable to allocate net_device structure!\n");
+ return NULL;
+ }
 
         if (dev->mem_start > 0)
                 option = dev->mem_start;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 23 2002 - 21:00:44 EST