patch-2.4.0-test9 linux/drivers/net/wan/comx-hw-comx.c
Next file: linux/drivers/net/wan/comx-hw-locomx.c
Previous file: linux/drivers/net/wan/Makefile
Back to the patch index
Back to the overall index
- Lines: 124
- Date:
Mon Oct 2 12:00:16 2000
- Orig file:
v2.4.0-test8/linux/drivers/net/wan/comx-hw-comx.c
- Orig date:
Sun May 21 20:34:37 2000
diff -u --recursive --new-file v2.4.0-test8/linux/drivers/net/wan/comx-hw-comx.c linux/drivers/net/wan/comx-hw-comx.c
@@ -9,6 +9,9 @@
*
* Copyright (C) 1995-2000 ITConsult-Pro Co. <info@itc.hu>
*
+ * Contributors:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 0.86
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
@@ -37,13 +40,12 @@
* Version 0.85 (00/01/14):
* - some additional workarounds :/
* - printk cleanups
+ * Version 0.86 (00/08/15):
+ * - resource release on failure at COMX_init
*/
-#define VERSION "0.85"
+#define VERSION "0.86"
-#include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/delay.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
@@ -52,6 +54,9 @@
#include <linux/proc_fs.h>
#include <linux/ioport.h>
#include <linux/init.h>
+#include <linux/delay.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
#include "comx.h"
#include "comxhw.h"
@@ -1224,7 +1229,7 @@
if ((new_file = create_proc_entry(FILENAME_IO, S_IFREG | 0644, ch->procdir))
== NULL) {
- return -EIO;
+ goto cleanup_HW_privdata;
}
new_file->data = (void *)new_file;
new_file->read_proc = &comxhw_read_proc;
@@ -1234,7 +1239,7 @@
if ((new_file = create_proc_entry(FILENAME_IRQ, S_IFREG | 0644, ch->procdir))
== NULL) {
- return -EIO;
+ goto cleanup_filename_io;
}
new_file->data = (void *)new_file;
new_file->read_proc = &comxhw_read_proc;
@@ -1244,7 +1249,7 @@
if ((new_file = create_proc_entry(FILENAME_CHANNEL, S_IFREG | 0644,
ch->procdir)) == NULL) {
- return -EIO;
+ goto cleanup_filename_irq;
}
new_file->data = (void *)new_file;
new_file->read_proc = &comxhw_read_proc;
@@ -1255,7 +1260,7 @@
if (ch->hardware == &hicomx_hw || ch->hardware == &cmx_hw) {
if ((new_file = create_proc_entry(FILENAME_CLOCK, S_IFREG | 0644,
ch->procdir)) == NULL) {
- return -EIO;
+ goto cleanup_filename_channel;
}
new_file->data = (void *)new_file;
new_file->read_proc = &comxhw_read_proc;
@@ -1266,7 +1271,7 @@
if ((new_file = create_proc_entry(FILENAME_MEMADDR, S_IFREG | 0644,
ch->procdir)) == NULL) {
- return -EIO;
+ goto cleanup_filename_clock;
}
new_file->data = (void *)new_file;
new_file->read_proc = &comxhw_read_proc;
@@ -1276,7 +1281,7 @@
if ((new_file = create_proc_entry(FILENAME_TWIN, S_IFREG | 0444,
ch->procdir)) == NULL) {
- return -EIO;
+ goto cleanup_filename_memaddr;
}
new_file->data = (void *)new_file;
new_file->read_proc = &comxhw_read_proc;
@@ -1285,7 +1290,7 @@
if ((new_file = create_proc_entry(FILENAME_FIRMWARE, S_IFREG | 0644,
ch->procdir)) == NULL) {
- return -EIO;
+ goto cleanup_filename_twin;
}
new_file->data = (void *)new_file;
new_file->read_proc = &comxhw_read_proc;
@@ -1326,6 +1331,23 @@
MOD_INC_USE_COUNT;
return 0;
+
+cleanup_filename_twin:
+ remove_proc_entry(FILENAME_TWIN, ch->procdir);
+cleanup_filename_memaddr:
+ remove_proc_entry(FILENAME_MEMADDR, ch->procdir);
+cleanup_filename_clock:
+ if (ch->hardware == &hicomx_hw || ch->hardware == &cmx_hw)
+ remove_proc_entry(FILENAME_CLOCK, ch->procdir);
+cleanup_filename_channel:
+ remove_proc_entry(FILENAME_CHANNEL, ch->procdir);
+cleanup_filename_irq:
+ remove_proc_entry(FILENAME_IRQ, ch->procdir);
+cleanup_filename_io:
+ remove_proc_entry(FILENAME_IO, ch->procdir);
+cleanup_HW_privdata:
+ kfree(ch->HW_privdata);
+ return -EIO;
}
/* Called on echo valami >boardtype */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)