From: William Theesfeld <william@theesfeld.net>
To: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Christian König <christian.koenig@amd.com>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] drm/amdkfd: convert CRIU event-private allocation to kvcalloc()
Date: Mon, 1 Jun 2026 15:55:10 -0400 [thread overview]
Message-ID: <20260601195510.639318-1-william@theesfeld.net> (raw)
criu_checkpoint_events() allocates the ev_privs[] array, sized by the
runtime count returned from kfd_get_num_events(), using the open-coded
kvzalloc(n * sizeof(*p), ...) form. Switch to kvcalloc(), which
carries the same zero-on-allocation semantics and adds the standard
size_mul overflow check on the n * sizeof multiplication.
No functional change.
Signed-off-by: William Theesfeld <william@theesfeld.net>
---
drivers/gpu/drm/amd/amdkfd/kfd_events.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
index 44150a71f..9739214e2 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
@@ -543,7 +543,7 @@ int kfd_criu_checkpoint_events(struct kfd_process *p,
if (!num_events)
return 0;
- ev_privs = kvzalloc(num_events * sizeof(*ev_privs), GFP_KERNEL);
+ ev_privs = kvcalloc(num_events, sizeof(*ev_privs), GFP_KERNEL);
if (!ev_privs)
return -ENOMEM;
--
2.54.0
next reply other threads:[~2026-06-01 22:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 19:55 William Theesfeld [this message]
2026-06-03 16:16 ` [PATCH] drm/amdkfd: convert CRIU event-private allocation to kvcalloc() Kuehling, Felix
2026-06-04 3:42 ` Claude review: " Claude Code Review Bot
2026-06-04 3:42 ` 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=20260601195510.639318-1-william@theesfeld.net \
--to=william@theesfeld.net \
--cc=Felix.Kuehling@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=simona@ffwll.ch \
/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