patch-2.4.7 linux/net/irda/irproc.c

Next file: linux/net/irda/irqueue.c
Previous file: linux/net/irda/irlmp_event.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.6/linux/net/irda/irproc.c linux/net/irda/irproc.c
@@ -67,6 +67,8 @@
 	int i;
 
 	proc_irda = proc_mkdir("net/irda", NULL);
+	if (proc_irda == NULL)
+		return;
 	proc_irda->owner = THIS_MODULE;
 
 	for (i=0;i<IRDA_ENTRIES_NUM;i++)
@@ -83,10 +85,13 @@
 {
 	int i;
 
-	for (i=0;i<IRDA_ENTRIES_NUM;i++)
-		remove_proc_entry(dir[i].name, proc_irda);
+        if (proc_irda) {
+                for (i=0;i<IRDA_ENTRIES_NUM;i++)
+                        remove_proc_entry(dir[i].name, proc_irda);
 
-	remove_proc_entry("net/irda", NULL);
+                remove_proc_entry("net/irda", NULL);
+                proc_irda = NULL;
+        }
 }
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)