From: Michal Hocko <mhocko@suse.com>
To: Zhaoyang Huang <huangzhaoyang@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
chunyan.zhang@unisoc.com,
Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] trace : use kvmalloc instead of kmalloc
Date: Thu, 30 Jul 2020 10:37:17 +0200 [thread overview]
Message-ID: <20200730083717.GB18727@dhcp22.suse.cz> (raw)
In-Reply-To: <1596023309-14403-1-git-send-email-zhaoyang.huang@unisoc.com>
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
next prev parent reply other threads:[~2020-07-30 8:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 11:48 Zhaoyang Huang
2020-07-30 8:37 ` Michal Hocko [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-30 11:04 Zhaoyang Huang
2020-07-30 13:58 ` Steven Rostedt
2020-07-31 0:24 ` Zhaoyang Huang
2020-07-30 14:01 ` Steven Rostedt
2020-07-29 11:30 Zhaoyang Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200730083717.GB18727@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=chunyan.zhang@unisoc.com \
--cc=huangzhaoyang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=zhaoyang.huang@unisoc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®