diff options
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) | |||
| 2258 | pid_t tgid = task_tgid_nr_ns(current, ns); | 2258 | pid_t tgid = task_tgid_nr_ns(current, ns); |
| 2259 | char *name = ERR_PTR(-ENOENT); | 2259 | char *name = ERR_PTR(-ENOENT); |
| 2260 | if (tgid) { | 2260 | if (tgid) { |
| 2261 | name = __getname(); | 2261 | /* 11 for max length of signed int in decimal + NULL term */ |
| 2262 | name = kmalloc(12, GFP_KERNEL); | ||
| 2262 | if (!name) | 2263 | if (!name) |
| 2263 | name = ERR_PTR(-ENOMEM); | 2264 | name = ERR_PTR(-ENOMEM); |
| 2264 | else | 2265 | else |
| @@ -2273,7 +2274,7 @@ static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd, | |||
| 2273 | { | 2274 | { |
| 2274 | char *s = nd_get_link(nd); | 2275 | char *s = nd_get_link(nd); |
| 2275 | if (!IS_ERR(s)) | 2276 | if (!IS_ERR(s)) |
| 2276 | __putname(s); | 2277 | kfree(s); |
| 2277 | } | 2278 | } |
| 2278 | 2279 | ||
| 2279 | static const struct inode_operations proc_self_inode_operations = { | 2280 | static const struct inode_operations proc_self_inode_operations = { |
