lkml.org 
[lkml]   [2022]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] proc: use kmalloc instead of __get_free_page() to alloc path buffer
On Sun, Jan 23, 2022 at 10:08:37AM +0000, Hao Lee wrote:
> It's not a standard approach that use __get_free_page() to alloc path
> buffer directly. We'd better use kmalloc and PATH_MAX.

> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -1764,25 +1764,26 @@ static const char *proc_pid_get_link(struct dentry *dentry,
>
> static int do_proc_readlink(struct path *path, char __user *buffer, int buflen)
> {
> - char *tmp = (char *)__get_free_page(GFP_KERNEL);
> + char *buf = NULL;

I'd rather not rename anything but keep it minimal.

\
 
 \ /
  Last update: 2022-01-23 14:56    [W:0.057 / U:2.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site