From: Breno Leitao <leitao@debian.org>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org,
akpm@linux-foundation.org, bp@alien8.de,
pawan.kumar.gupta@linux.intel.com, mingo@kernel.org,
feng.tang@linux.alibaba.com, kees@kernel.org, elver@google.com,
arnd@arndb.de, lirongqing@baidu.com, fvdl@google.com,
bhelgaas@google.com, bhe@redhat.com,
dave.hansen@linux.intel.com, rppt@kernel.org,
ryan.roberts@arm.com, ardb@kernel.org, osandov@fb.com,
jbohac@suse.cz, sourabhjain@linux.ibm.com, cfsworks@gmail.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: kexec: Add support for crashkernel CMA reservation
Date: Fri, 23 Jan 2026 01:29:53 -0800 [thread overview]
Message-ID: <aXM-vOUVbD8iwicr@gmail.com> (raw)
In-Reply-To: <20260123074820.310605-1-ruanjinjie@huawei.com>
Hello Jinjie,
On Fri, Jan 23, 2026 at 03:48:20PM +0800, Jinjie Ruan wrote:
> Extend crashkernel CMA reservation support to arm64.
This is awesome. I was waiting for this patch! Thanks for working on it.
> @@ -75,6 +81,13 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
> goto out;
> }
>
> + for (i = 0; i < crashk_cma_cnt; ++i) {
> + ret = crash_exclude_mem_range(cmem, crashk_cma_ranges[i].start,
> + crashk_cma_ranges[i].end);
> + if (ret)
> + return ret;
Don't you want to "goto out" here, given you want to free cmem.
earlirer in this function, it does:
cmem = kmalloc(struct_size(cmem, ranges, nr_ranges), GFP_KERNEL);
you probably want to free it before returning an error, given
prepare_elf_headers() will return an error, which will fail load image,
causing the memory leak for cmem above.
next prev parent reply other threads:[~2026-01-23 9:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 7:48 [PATCH] arm64: kexec: Add support for crashkernel CMA reservation Jinjie Ruan
2026-01-23 9:29 ` Breno Leitao [this message]
2026-01-23 11:24 ` Ard Biesheuvel
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=aXM-vOUVbD8iwicr@gmail.com \
--to=leitao@debian.org \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=bhe@redhat.com \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=cfsworks@gmail.com \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=elver@google.com \
--cc=feng.tang@linux.alibaba.com \
--cc=fvdl@google.com \
--cc=jbohac@suse.cz \
--cc=kees@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=mingo@kernel.org \
--cc=osandov@fb.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=rppt@kernel.org \
--cc=ruanjinjie@huawei.com \
--cc=ryan.roberts@arm.com \
--cc=sourabhjain@linux.ibm.com \
--cc=will@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.