diff options
Diffstat (limited to 'fs/proc/thread_self.c')
-rw-r--r-- | fs/proc/thread_self.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/proc/thread_self.c b/fs/proc/thread_self.c index b813e3b529f2..9d2efaca499f 100644 --- a/fs/proc/thread_self.c +++ b/fs/proc/thread_self.c | |||
@@ -1,4 +1,5 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <linux/cache.h> | ||
2 | #include <linux/sched.h> | 3 | #include <linux/sched.h> |
3 | #include <linux/slab.h> | 4 | #include <linux/slab.h> |
4 | #include <linux/pid_namespace.h> | 5 | #include <linux/pid_namespace.h> |
@@ -18,11 +19,10 @@ static const char *proc_thread_self_get_link(struct dentry *dentry, | |||
18 | 19 | ||
19 | if (!pid) | 20 | if (!pid) |
20 | return ERR_PTR(-ENOENT); | 21 | return ERR_PTR(-ENOENT); |
21 | name = kmalloc(PROC_NUMBUF + 6 + PROC_NUMBUF, | 22 | name = kmalloc(10 + 6 + 10 + 1, dentry ? GFP_KERNEL : GFP_ATOMIC); |
22 | dentry ? GFP_KERNEL : GFP_ATOMIC); | ||
23 | if (unlikely(!name)) | 23 | if (unlikely(!name)) |
24 | return dentry ? ERR_PTR(-ENOMEM) : ERR_PTR(-ECHILD); | 24 | return dentry ? ERR_PTR(-ENOMEM) : ERR_PTR(-ECHILD); |
25 | sprintf(name, "%d/task/%d", tgid, pid); | 25 | sprintf(name, "%u/task/%u", tgid, pid); |
26 | set_delayed_call(done, kfree_link, name); | 26 | set_delayed_call(done, kfree_link, name); |
27 | return name; | 27 | return name; |
28 | } | 28 | } |
@@ -31,7 +31,7 @@ static const struct inode_operations proc_thread_self_inode_operations = { | |||
31 | .get_link = proc_thread_self_get_link, | 31 | .get_link = proc_thread_self_get_link, |
32 | }; | 32 | }; |
33 | 33 | ||
34 | static unsigned thread_self_inum; | 34 | static unsigned thread_self_inum __ro_after_init; |
35 | 35 | ||
36 | int proc_setup_thread_self(struct super_block *s) | 36 | int proc_setup_thread_self(struct super_block *s) |
37 | { | 37 | { |