From: Junrui Luo <moonafterrain@outlook.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Alex Deucher <alexander.deucher@amd.com>,
Christian König <christian.koenig@amd.com>,
David Airlie <airlied@gmail.com>,
Prike Liang <Prike.Liang@amd.com>,
Simona Vetter <simona@ffwll.ch>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Yuhao Jiang <danisjiang@gmail.com>
Subject: Re: [PATCH] drm/amdgpu/userq: fix memory leak in MQD creation error paths
Date: Sun, 15 Mar 2026 05:25:11 +0000 [thread overview]
Message-ID: <51CF1DD4-7CB7-4B5B-BDF9-3411B921B5D7@outlook.com> (raw)
In-Reply-To: <bed7f0c7-4346-41d0-ac5f-f5a897888533@web.de>
On Sat, Mar 14, 2026 at 09:04:08PM +0100, Markus Elfring wrote:
> …
> > Fix by adding kfree() before each goto free_mqd on VA validation
> > failure in the COMPUTE, GFX, and SDMA branches.
>
> How do you think about to benefit any more from application of an attribute
> like __free(kfree)?
> https://elixir.bootlin.com/linux/v7.0-rc3/source/include/linux/cleanup.h#L157-L161
Hi Markus,
Thanks for the suggestion. I considered __free(kfree) but the cleanup.h
comment says scope-based cleanup and "goto" should not be mixed in the same
function. Since mes_userq_mqd_create() relies heavily on goto-based
unwinding, applying __free(kfree) only to the memdup pointers would
violate that guideline.
A full conversion to scope-based cleanup would require restructuring
the entire function, which seems beyond the scope of a bug fix.
Thanks,
Junrui Luo
next prev parent reply other threads:[~2026-03-15 5:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 15:33 [PATCH] drm/amdgpu/userq: fix memory leak in MQD creation error paths Junrui Luo
2026-03-14 20:04 ` Markus Elfring
2026-03-15 5:25 ` Junrui Luo [this message]
2026-03-15 9:50 ` Markus Elfring
2026-03-16 1:58 ` Claude review: " Claude Code Review Bot
2026-03-16 1:58 ` Claude Code Review Bot
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=51CF1DD4-7CB7-4B5B-BDF9-3411B921B5D7@outlook.com \
--to=moonafterrain@outlook.com \
--cc=Markus.Elfring@web.de \
--cc=Prike.Liang@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=danisjiang@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox