aboutsummaryrefslogtreecommitdiffstats
path: root/fs/seq_file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-12-07 08:14:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-07 08:14:42 -0800
commit3172f8fe1ca1d432b196efad453c0ceb89302075 (patch)
tree0b9e8af7ea9ee9883ff1a834357694254200335a /fs/seq_file.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff)
parentfix apparmor dereferencing potentially freed dentry, sanitize __d_path() API (diff)
downloadlinux-dev-3172f8fe1ca1d432b196efad453c0ceb89302075.tar.xz
linux-dev-3172f8fe1ca1d432b196efad453c0ceb89302075.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix apparmor dereferencing potentially freed dentry, sanitize __d_path() API
Diffstat (limited to 'fs/seq_file.c')
-rw-r--r--fs/seq_file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 05d6b0e78c95..dba43c3ea3af 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -449,8 +449,6 @@ EXPORT_SYMBOL(seq_path);
/*
* Same as seq_path, but relative to supplied root.
- *
- * root may be changed, see __d_path().
*/
int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
char *esc)
@@ -463,6 +461,8 @@ int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
char *p;
p = __d_path(path, root, buf, size);
+ if (!p)
+ return SEQ_SKIP;
res = PTR_ERR(p);
if (!IS_ERR(p)) {
char *end = mangle_path(buf, p, esc);
@@ -474,7 +474,7 @@ int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
}
seq_commit(m, res);
- return res < 0 ? res : 0;
+ return res < 0 && res != -ENAMETOOLONG ? res : 0;
}
/*