From: Rob Herring <robh@kernel.org>
To: pierre Kuo <vichy.kuo@gmail.com>
Cc: Frank Rowand <frowand.list@gmail.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] of: reserved_mem: fix reserve memory leak
Date: Wed, 10 Apr 2019 08:56:48 -0500 [thread overview]
Message-ID: <20190410135648.GA25739@bogus> (raw)
In-Reply-To: <20190219074500.16454-1-vichy.kuo@gmail.com>
On Tue, Feb 19, 2019 at 03:45:00PM +0800, pierre Kuo wrote:
> The __reserved_mem_init_node will call region specific reserved memory
> init codes, but once all compatibled init codes failed, the memory region
> will left in memory.reserved and cause leakage.
>
> Take cma reserve memory DTS for example, if user declare 1MB size,
> which is not align to (PAGE_SIZE << max(MAX_ORDER - 1,
> pageblock_order)), rmem_cma_setup will return -EINVAL.
> Meanwhile, rmem_dma_setup will also return -EINVAL since "reusable"
> property is not set. If finally there is no reserved memory init pick up
> this memory, kernel will left the 1MB leak in memory.reserved.
>
> This patch will remove this kind of memory from memory.reserved, only
> when __reserved_mem_init_node return neither 0 nor -ENOENT.
>
> Signed-off-by: pierre Kuo <vichy.kuo@gmail.com>
> ---
> drivers/of/of_reserved_mem.c | 22 +++++++++++++++++-----
> 1 file changed, 17 insertions(+), 5 deletions(-)
As no one else seems to have any comments, I've applied it.
Rob
next prev parent reply other threads:[~2019-04-10 13:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-19 7:45 [PATCH 1/1] of: reserved_mem: fix reserve memory leak pierre Kuo
2019-03-04 16:37 ` Rob Herring
2019-03-05 3:36 ` pierre kuo
2019-03-12 1:58 ` pierre kuo
2019-04-09 2:11 ` pierre kuo
2019-04-09 2:13 ` pierre kuo
2019-04-10 13:56 ` Rob Herring [this message]
2019-04-10 18:44 ` pierre kuo
2019-05-10 4:15 ` pierre kuo
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=20190410135648.GA25739@bogus \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vichy.kuo@gmail.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;
as well as URLs for NNTP newsgroup(s).