From: sashiko-bot@kernel.org
To: "Bence Csokas" <bence.csokas@arm.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/syncobj: Use scope-based cleanup for eventfd_ctx
Date: Wed, 09 Sep 2026 12:43:19 +0000 [thread overview]
Message-ID: <20260909124320.67E0F1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909-efd-autofree-v1-2-c6c3c19cc702@arm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Mixing goto-based error handling with scope-based cleanup (__free) in the same function.
--
commit 991d574653fb7465f62bf99703d5af0d6fe21920
Author: Bence Csokas <bence.csokas@arm.com>
drm/syncobj: Use scope-based cleanup for eventfd_ctx
This patch modifies drm_syncobj_eventfd_ioctl() to use the scope-based
cleanup helper for eventfd_ctx, removing the explicit put calls.
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index c23a5de27effa..261d5606e8bd8 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;
[ ... ]
> @@ -1502,8 +1503,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;
[Severity: Medium]
Does this code in drivers/gpu/drm/drm_syncobj.c:drm_syncobj_eventfd_ioctl()
mix goto-based error handling and scope-based cleanup in the same function?
The cleanup subsystem documentation in include/linux/cleanup.h states that for
a given routine, all resources that need a "goto" cleanup should be converted
to scope-based cleanup, or none of them should be. Mixing the two creates
confusing ownership semantics.
Could the syncobj cleanup also be converted to use __free(), or should we
stick to goto-based cleanup for both resources in this function?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909-efd-autofree-v1-0-c6c3c19cc702@arm.com?part=2
prev parent reply other threads:[~2026-09-09 12:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 12:36 [PATCH 0/2] Add scope-based cleanup capability to eventfd_ctx Bence Csokas
2026-09-09 12:36 ` [PATCH 1/2] eventfd: Add scope-based cleanup capability Bence Csokas
2026-09-09 12:42 ` sashiko-bot
2026-09-09 12:36 ` [PATCH 2/2] drm/syncobj: Use scope-based cleanup for eventfd_ctx Bence Csokas
2026-09-09 12:43 ` sashiko-bot [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=20260909124320.67E0F1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bence.csokas@arm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.