From: Bence Csokas <bence.csokas@arm.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>
Cc: Bence Csokas <bence.csokas@arm.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: [PATCH v2 2/2] drm/syncobj: Use scope-based cleanup for eventfd_ctx
Date: Tue, 15 Sep 2026 13:09:24 +0200 [thread overview]
Message-ID: <20260915-efd-autofree-v2-2-06d2c9d1547f@arm.com> (raw)
In-Reply-To: <20260915-efd-autofree-v2-0-06d2c9d1547f@arm.com>
Now that eventfd supports __free(), use it in drm_syncobj_eventfd_ioctl().
Signed-off-by: Bence Csokas <bence.csokas@arm.com>
---
drivers/gpu/drm/drm_syncobj.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index c23a5de27eff..efc4e8af220c 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -1462,9 +1462,9 @@ int
drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_private)
{
+ struct eventfd_ctx *ev_fd_ctx __free(eventfd) = NULL;
struct drm_syncobj_eventfd *args = data;
struct drm_syncobj *syncobj;
- struct eventfd_ctx *ev_fd_ctx;
struct syncobj_eventfd_entry *entry;
int ret;
@@ -1490,10 +1490,10 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
entry = kzalloc_obj(*entry);
if (!entry) {
ret = -ENOMEM;
- goto err_kzalloc;
+ goto err_fdget;
}
entry->syncobj = syncobj;
- entry->ev_fd_ctx = ev_fd_ctx;
+ entry->ev_fd_ctx = no_free_ptr(ev_fd_ctx);
entry->point = args->point;
entry->flags = args->flags;
@@ -1502,8 +1502,6 @@ drm_syncobj_eventfd_ioctl(struct drm_device *dev, void *data,
return 0;
-err_kzalloc:
- eventfd_ctx_put(ev_fd_ctx);
err_fdget:
drm_syncobj_put(syncobj);
return ret;
--
2.55.0
prev parent reply other threads:[~2026-09-15 11:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 11:09 [PATCH v2 0/2] Add scope-based cleanup capability to eventfd_ctx Bence Csokas
2026-09-15 11:09 ` [PATCH v2 1/2] eventfd: Add scope-based cleanup capability Bence Csokas
2026-09-15 11:09 ` Bence Csokas [this message]
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=20260915-efd-autofree-v2-2-06d2c9d1547f@arm.com \
--to=bence.csokas@arm.com \
--cc=airlied@gmail.com \
--cc=brauner@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®