lkml.org 
[lkml]   [2010]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 2.6.34-rc1] proc: fix badness in fs/proc/generic.c
From
fix badness in fs/proc/generic.c,  Bug 15589 -  2.6.34-rc1: Badness at
fs/proc/generic.c:316

Signed-off-by: Guanjun He <heguanbo@gmail.com>

---
diff -Nupr linux-2.6.34-rc1.orig/fs/proc/generic.c
linux-2.6.34-rc1/fs/proc/generic.c
--- linux-2.6.34-rc1.orig/fs/proc/generic.c 2010-03-09
02:45:44.000000000 +0800
+++ linux-2.6.34-rc1/fs/proc/generic.c 2010-04-21 19:02:49.000000000 +0800
@@ -297,11 +297,13 @@ static int __xlate_proc_name(const char
const char *cp = name, *next;
struct proc_dir_entry *de;
int len;
+ int rtn = 0;

de = *ret;
if (!de)
de = &proc_root;

+ spin_lock(&proc_subdir_lock);
while (1) {
next = strchr(cp, '/');
if (!next)
@@ -313,14 +315,17 @@ static int __xlate_proc_name(const char
break;
}
if (!de) {
- WARN(1, "name '%s'\n", name);
- return -ENOENT;
+ WARN(1, "name \"%s\"\n", name);
+ rtn = -ENOENT;
+ goto out;
}
cp += len + 1;
}
*residual = cp;
*ret = de;
- return 0;
+out:
+ spin_unlock(&proc_subdir_lock);
+ return rtn;
}

static int xlate_proc_name(const char *name, struct proc_dir_entry **ret,

\
 
 \ /
  Last update: 2010-04-21 13:11    [W:0.082 / U:0.060 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site