[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200730083717.GB18727@dhcp22.suse.cz>
Date: Thu, 30 Jul 2020 10:37:17 +0200
From: Michal Hocko <mhocko@...e.com>
To: Zhaoyang Huang <huangzhaoyang@...il.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>, chunyan.zhang@...soc.com,
Zhaoyang Huang <zhaoyang.huang@...soc.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] trace : use kvmalloc instead of kmalloc
On Wed 29-07-20 19:48:29, Zhaoyang Huang wrote:
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index ca1ee65..d4eb7ea 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -6891,7 +6891,7 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp)
> if (trace_array_get(tr) < 0)
> return -ENODEV;
>
> - info = kzalloc(sizeof(*info), GFP_KERNEL);
> + info = kvmalloc(sizeof(*info), GFP_KERNEL);
I am not familiar with the code but it is quite clear that the patch is
incomplete without matching kvfree call in the release path. You cannot
simply change k.malloc to kvmalloc without the pairing kvfree.
> if (!info) {
> trace_array_put(tr);
> return -ENOMEM;
> --
> 1.9.1
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists