summaryrefslogtreecommitdiffstats
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorDavid Howells2018-06-13 20:43:19 +0200
committerAl Viro2018-06-15 06:48:57 +0200
commit24074a35c5c975c94cd9691ae962855333aac47f (patch)
tree1b59ef017c85f158edf696564fe441fa2356ca3e /fs/proc/generic.c
parentMerge tag 'afs-fixes-20180514' into afs-proc (diff)
downloadkernel-qcow2-linux-24074a35c5c975c94cd9691ae962855333aac47f.tar.gz
kernel-qcow2-linux-24074a35c5c975c94cd9691ae962855333aac47f.tar.xz
kernel-qcow2-linux-24074a35c5c975c94cd9691ae962855333aac47f.zip
proc: Make inline name size calculation automatic
Make calculation of the size of the inline name in struct proc_dir_entry automatic, rather than having to manually encode the numbers and failing to allow for lockdep. Require a minimum inline name size of 33+1 to allow for names that look like two hex numbers with a dash between. Reported-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r--fs/proc/generic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index d0e5a68ae14a..210bd4b16947 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -410,7 +410,7 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
if (!ent)
goto out;
- if (qstr.len + 1 <= sizeof(ent->inline_name)) {
+ if (qstr.len + 1 <= SIZEOF_PDE_INLINE_NAME) {
ent->name = ent->inline_name;
} else {
ent->name = kmalloc(qstr.len + 1, GFP_KERNEL);