drivers/gpu/drm/drm_atomic_uapi.c | 3 --- 1 file changed, 3 deletions(-)
Since file_priv can never be NULL at prepare_signaling() as it is only
called by drm_mode_atomic_ioctl(), remove the check.
If that was not the case, skipping the rest of the block here would cause
the drm_pending_vblank_event object to leak and fail to set up the fence in
case out_fence_ptr is set.
Since the check is unreachable, there is no possible leak.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
---
Changes in v2:
- Change commit message to indicate this is not a reachable leak.
- Link to v1: https://patch.msgid.link/20260729-drm_atomic_bogus_check-v1-1-a4d5bd4ae4c8@igalia.com
---
drivers/gpu/drm/drm_atomic_uapi.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index e997917819e8..657c15474ed5 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1445,9 +1445,6 @@ static int prepare_signaling(struct drm_device *dev,
if (arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {
struct drm_pending_vblank_event *e = crtc_state->event;
- if (!file_priv)
- continue;
-
ret = drm_event_reserve_init(dev, file_priv, &e->base,
&e->event.base);
if (ret) {
---
base-commit: ab243f74ab4084ca5c8dec608cb5b0deb27db067
change-id: 20260729-drm_atomic_bogus_check-456d5fb6eee9
Best regards,
--
Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
On 17/08/2026 20:45, Thadeu Lima de Souza Cascardo wrote:
> Since file_priv can never be NULL at prepare_signaling() as it is only
> called by drm_mode_atomic_ioctl(), remove the check.
>
> If that was not the case, skipping the rest of the block here would cause
> the drm_pending_vblank_event object to leak and fail to set up the fence in
> case out_fence_ptr is set.
>
> Since the check is unreachable, there is no possible leak.
>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Applied to drm-misc-fixes.
commit d32b08284f44c20edb2ea3f64ba0a6a165036fb2
Melissa
> ---
> Changes in v2:
> - Change commit message to indicate this is not a reachable leak.
> - Link to v1: https://patch.msgid.link/20260729-drm_atomic_bogus_check-v1-1-a4d5bd4ae4c8@igalia.com
> ---
> drivers/gpu/drm/drm_atomic_uapi.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index e997917819e8..657c15474ed5 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1445,9 +1445,6 @@ static int prepare_signaling(struct drm_device *dev,
> if (arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {
> struct drm_pending_vblank_event *e = crtc_state->event;
>
> - if (!file_priv)
> - continue;
> -
> ret = drm_event_reserve_init(dev, file_priv, &e->base,
> &e->event.base);
> if (ret) {
>
> ---
> base-commit: ab243f74ab4084ca5c8dec608cb5b0deb27db067
> change-id: 20260729-drm_atomic_bogus_check-456d5fb6eee9
>
> Best regards,
> --
> Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
>
On 17/08/2026 20:45, Thadeu Lima de Souza Cascardo wrote:
> Since file_priv can never be NULL at prepare_signaling() as it is only
> called by drm_mode_atomic_ioctl(), remove the check.
>
> If that was not the case, skipping the rest of the block here would cause
> the drm_pending_vblank_event object to leak and fail to set up the fence in
> case out_fence_ptr is set.
>
> Since the check is unreachable, there is no possible leak.
Reviewed-by: Melissa Wen <mwen@igalia.com>
>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
> ---
> Changes in v2:
> - Change commit message to indicate this is not a reachable leak.
> - Link to v1: https://patch.msgid.link/20260729-drm_atomic_bogus_check-v1-1-a4d5bd4ae4c8@igalia.com
> ---
> drivers/gpu/drm/drm_atomic_uapi.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index e997917819e8..657c15474ed5 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1445,9 +1445,6 @@ static int prepare_signaling(struct drm_device *dev,
> if (arg->flags & DRM_MODE_PAGE_FLIP_EVENT) {
> struct drm_pending_vblank_event *e = crtc_state->event;
>
> - if (!file_priv)
> - continue;
> -
> ret = drm_event_reserve_init(dev, file_priv, &e->base,
> &e->event.base);
> if (ret) {
>
> ---
> base-commit: ab243f74ab4084ca5c8dec608cb5b0deb27db067
> change-id: 20260729-drm_atomic_bogus_check-456d5fb6eee9
>
> Best regards,
> --
> Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
>
© 2016 - 2026 Red Hat, Inc.