From: sashiko-bot@kernel.org
To: "Tvrtko Ursulin" <tvrtko.ursulin@igalia.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/7] drm/syncobj: Use scoped cleanup for drm_syncobj_array_wait_timeout syncobjs
Date: Thu, 26 Nov 2026 11:17:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-235358@kernel.org> (raw)
In-Reply-To: <20261126111117.67342-4-tvrtko.ursulin@igalia.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/syncobj: separate declaration and init of __free() in
wait_timeout
--
commit 7b5691e728edfdbf53ebabd68fe3be6523faee57
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
drm/syncobj: Use scoped cleanup for drm_syncobj_array_wait_timeout syncobjs
This commit converts the entries allocation and syncobj wait cleanup in
drm_syncobj_array_wait_timeout() to use a DEFINE_FREE() scope-managed cleanup
helper instead of goto labels.
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index bd3f9e74e678f..7d5c4e4e29b20 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
[ ... ]
> @@ -1052,6 +1077,7 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
> uint32_t *idx,
> ktime_t *deadline)
> {
> + struct syncobj_wait_entries cleanup __free(syncobj_wait_entries) = {};
> struct syncobj_wait_entry *entries;
> u64 *points __free(kvfree) = NULL;
> struct dma_fence *fence;
> @@ -1076,6 +1102,11 @@ static signed long drm_syncobj_array_wait_timeout(struct drm_syncobj **syncobjs,
> if (!entries)
> return -ENOMEM;
>
> + /* After this the entries cleanup is fully automatic. */
> + cleanup.syncobjs = syncobjs;
> + cleanup.entries = entries;
> + cleanup.count = count;
[Severity: Low]
Could cleanup be defined and initialized in a single statement right after
entries is allocated rather than declared empty at the top of the function?
Per include/linux/cleanup.h conventions, defining __free() variables at their
point of initialization preserves LIFO destruction order relative to points
and avoids running syncobj_wait_entries_free() on early returns before
entries is allocated.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126111117.67342-1-tvrtko.ursulin@igalia.com?part=3
next prev parent reply other threads:[~2026-11-26 11:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 11:11 [PATCH 0/7] DRM syncobj scoped cleanup and fast path Tvrtko Ursulin
2026-11-26 11:11 ` [PATCH 1/7] drm/syncobj: Use vmemdup_array_user in drm_syncobj_array_find Tvrtko Ursulin
2026-11-26 11:59 ` Christian König
2026-11-26 11:11 ` [PATCH 2/7] drm/syncobj: Use scoped cleanup for drm_syncobj_array_wait_timeout points Tvrtko Ursulin
2026-11-26 12:09 ` Christian König
2026-11-26 14:22 ` Tvrtko Ursulin
2026-11-26 11:11 ` [PATCH 3/7] drm/syncobj: Use scoped cleanup for drm_syncobj_array_wait_timeout syncobjs Tvrtko Ursulin
2026-11-26 11:17 ` sashiko-bot [this message]
2026-11-26 12:11 ` Christian König
2026-11-26 14:33 ` Tvrtko Ursulin
2026-11-26 11:11 ` [PATCH 4/7] drm/syncobj: Use scoped cleanup for drm_syncobj_timeline_signal_ioctl points Tvrtko Ursulin
2026-11-26 12:15 ` Christian König
2026-11-26 11:11 ` [PATCH 5/7] drm/syncobj: Use scoped cleanup for drm_syncobj_timeline_signal_ioctl chains Tvrtko Ursulin
2026-11-26 11:21 ` sashiko-bot
2026-11-26 12:19 ` Christian König
2026-11-26 11:11 ` [PATCH 6/7] drm/syncobj: Use scoped cleanup in drm_syncobj_array_find and callers Tvrtko Ursulin
2026-11-26 11:19 ` sashiko-bot
2026-11-26 11:11 ` [PATCH 7/7] drm/syncobj: Add temporary array allocation fast paths Tvrtko Ursulin
2026-11-26 11:22 ` sashiko-bot
2026-11-26 11:49 ` [PATCH v2 " Tvrtko Ursulin
2026-11-27 7:59 ` Fei Yu
2026-11-27 7:58 ` [PATCH 0/7] DRM syncobj scoped cleanup and fast path Fei Yu
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=sashiko-outbox-235358@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tvrtko.ursulin@igalia.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 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.