--- arch/i386/kernel/irq.c.orig	Sun May  6 23:45:09 2001
+++ arch/i386/kernel/irq.c	Sun May  6 23:48:26 2001
@@ -1137,6 +1137,11 @@
 	/* create /proc/irq/1234/smp_affinity */
 	entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
 
+	if (!entry) {
+	    remove_proc_entry(name, root_irq_dir);
+	    return;
+	}
+
 	entry->nlink = 1;
 	entry->data = (void *)(long)irq;
 	entry->read_proc = irq_affinity_read_proc;
@@ -1157,6 +1162,11 @@
 
 	/* create /proc/irq/prof_cpu_mask */
 	entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
+
+	if (!entry) {
+	    remove_proc_entry("irq", 0);
+	    return;
+	}
 
 	entry->nlink = 1;
 	entry->data = (void *)&prof_cpu_mask;
