lkml.org 
[lkml]   [2001]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] arch/i386/kernel/irq.c
Date
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
victor.wong@stanford.edu

--- 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 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 12:53    [W:0.127 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site