diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-10-10 22:43:21 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-13 02:15:10 +0200 |
commit | f81700bd831efcd12eb7f0e66b24b16c2ad00a32 (patch) | |
tree | 9763e5c46e31d2500b1ba9186b882622739c9295 /fs/proc/base.c | |
parent | vfs: embed struct filename inside of names_cache allocation if possible (diff) | |
download | linux-f81700bd831efcd12eb7f0e66b24b16c2ad00a32.tar.xz linux-f81700bd831efcd12eb7f0e66b24b16c2ad00a32.zip |
procfs: don't need a PATH_MAX allocation to hold a string representation of an int
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index ef5c84be66f9..144a96732dd7 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2258,7 +2258,8 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) pid_t tgid = task_tgid_nr_ns(current, ns); char *name = ERR_PTR(-ENOENT); if (tgid) { - name = __getname(); + /* 11 for max length of signed int in decimal + NULL term */ + name = kmalloc(12, GFP_KERNEL); if (!name) name = ERR_PTR(-ENOMEM); else @@ -2273,7 +2274,7 @@ static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd, { char *s = nd_get_link(nd); if (!IS_ERR(s)) - __putname(s); + kfree(s); } static const struct inode_operations proc_self_inode_operations = { |