lkml.org 
[lkml]   [2002]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][2.2] eepro100 - gracefully handle init_etherdev failure
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/

\
 
 \ /
  Last update: 2005-03-22 13:15    [W:0.026 / U:1.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site