Re: [PATCH] drm/atomic: remove bogus check for file_priv

Thadeu Lima de Souza Cascardo <[email protected]>
Newsgroups org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Wed, Aug 12, 2026 at 06:19:34PM +0200, Melissa Wen wrote:
> 
> 
> On 29/07/2026 09:52, Thadeu Lima de Souza Cascardo wrote:
> > 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 file_priv can never be NULL at prepare_signaling() as it is only
> > called by drm_mode_atomic_ioctl(), simply remove the check.
> 
> Hey,
> 
> The change looks correct, but I'm a little confused by the first sentence,
> because, if `file_priv` can never be NULL, there's no real leak, right?
> 

That is correct!

> Could you clarify the first sentence by saying it's currently an unreachable
> bug? That way, people will not think it's a live bug and will understand
> that
> a Fixes tag isn't necessary.
> 

Agreed!

Let me resend.

Cascardo.

> With this small clarification added:
> 
> Reviewed-by: Melissa Wen <[email protected]>
> 
> Thanks!
> 
> > 
> > Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
> > ---
> >   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: d5efb1e1b1d7cd27c642654042f80d19a7ba3caf
> > change-id: 20260729-drm_atomic_bogus_check-456d5fb6eee9
> > 
> > Best regards,
> > --
> > Thadeu Lima de Souza Cascardo <[email protected]>
> > 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.