From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v11 1/9] drm/lease: Add a helper to tell whether a lease was revoked
Date: Mon, 16 Nov 2026 10:30:13 +0000 [thread overview]
Message-ID: <sashiko-outbox-216737@kernel.org> (raw)
In-Reply-To: <20261116-drm-reset-state-flag-v11-1-378b3f7bef32@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/lease: drm_lease_revoked() falsely reports empty leases
as revoked
--
commit 607dbf11bac99a263d86d7f9e9dbfe6aff207269
Author: Maxime Ripard <mripard@kernel.org>
drm/lease: Add a helper to tell whether a lease was revoked
This commit adds drm_lease_revoked() to check whether a drm_file belongs
to a lessee whose lease has been revoked.
> diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
> index 5d2cf724cbd7b..dd59df14dcc02 100644
> --- a/drivers/gpu/drm/drm_lease.c
> +++ b/drivers/gpu/drm/drm_lease.c
> @@ -147,6 +147,32 @@ bool drm_lease_held(struct drm_file *file_priv, int id)
> return ret;
> }
>
> +/*
> + * Checks whether the file is a lessee whose lease has been revoked. A
> + * lease is always revoked as a whole, so an empty one has been revoked.
> + */
> +bool drm_lease_revoked(struct drm_file *file_priv)
> +{
> + struct drm_master *master;
> + bool ret = false;
> +
> + if (!file_priv)
> + return false;
> +
> + master = drm_file_get_master(file_priv);
> + if (!master)
> + return false;
> +
> + if (master->lessor) {
> + mutex_lock(&master->dev->mode_config.idr_mutex);
> + ret = idr_is_empty(&master->leases);
> + mutex_unlock(&master->dev->mode_config.idr_mutex);
> + }
> +
> + drm_master_put(&master);
> + return ret;
> +}
[Severity: Medium]
Does drm_lease_revoked() falsely report an active empty lease as revoked?
Since commit 4bb2d367a5a2 ("drm/lease: allow empty leases"),
drm_mode_create_lease_ioctl() permits creating a lease with
object_count == 0, leaving master->lessor set and master->leases empty on
an unrevoked lease. Callers checking drm_lease_revoked() will treat valid
empty leases as revoked.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-drm-reset-state-flag-v11-0-378b3f7bef32@kernel.org?part=1
next prev parent reply other threads:[~2026-11-16 10:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 10:17 [PATCH v11 0/9] drm: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-11-16 10:17 ` [PATCH v11 1/9] drm/lease: Add a helper to tell whether a lease was revoked Maxime Ripard
2026-11-16 10:30 ` sashiko-bot [this message]
2026-11-16 10:17 ` [PATCH v11 2/9] drm/atomic: Add drm_atomic_implements_create_state() helper Maxime Ripard
2026-11-16 10:17 ` [PATCH v11 3/9] drm/atomic: Allow filling a commit with pristine object states Maxime Ripard
2026-11-16 10:41 ` sashiko-bot
2026-11-16 10:17 ` [PATCH v11 4/9] drm/tests: atomic: Add tests for drm_atomic_commit_fill_with_defaults() Maxime Ripard
2026-11-16 10:17 ` [PATCH v11 5/9] drm/amd/display: Take over the current stream and dc_state Maxime Ripard
2026-11-16 10:17 ` [PATCH v11 6/9] drm/vc4: Carry the HVS channel over to created CRTC states Maxime Ripard
2026-11-17 19:12 ` Dave Stevenson
2026-11-16 10:17 ` [PATCH v11 7/9] drm/msm/dpu1: Carry the mixers " Maxime Ripard
2026-11-16 10:17 ` [PATCH v11 8/9] drm/atomic-uapi: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-11-16 10:17 ` [PATCH v11 9/9] drm/vkms: Add driver-specific plane property for testing Maxime Ripard
2026-11-16 12:39 ` Louis Chauvet
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-216737@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mripard@kernel.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.