Hi,

The following patches to irq.c were made to deal with potential errors in
creating /proc entries for irqs on bootup. The code add checks to ensure
that the entries were created succesfully. In case of error, it attempts to
cleanup after itself. The patch was made against v2.4.4 of the kernel and
result from some errors found during checker runs against the kernel source.

Victor Wong
[EMAIL PROTECTED]

--- 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;

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

Reply via email to