On Thu, May 14, 2026 at 11:16:21AM -0400, Rodrigo Vivi wrote:
> On Mon, May 11, 2026 at 10:25:40PM +0800, Jonathan Cavitt wrote:
> > Remove the "if (ret < 0)" branch after idr_replace in
> > drm_gem_change_handle_ioctl. It is unused, as in the only place we
> > modify the return value between there and the previous return value
> > check, we also immediately jump to out_unlock, bypassing the check
> > entirely.
> >
> > Issue caught by static analysis.
>
> Reviewed-by: Rodrigo Vivi <[email protected]>
It doesn't apply in drm-misc branches yet because it doesn't yet
have the culprit patch that caused this code.
That is only part of drm-fixes:
5e28b7b94408 ("drm: Set old handle to NULL before prime swap in change_handle")
I believe this patch here can wait this culprit patch to get propagated
through a backmerge/rebase...
>
> >
> > Signed-off-by: Jonathan Cavitt <[email protected]>
> > Cc: Maarten Lankhorst <[email protected]>
> > Cc: Maxime Ripard <[email protected]>
> > Cc: Thomas Zimmermann <[email protected]>
> > Cc: David Airlie <[email protected]>
> > Cc: Simona Vetter <[email protected]>
> > ---
> > drivers/gpu/drm/drm_gem.c | 3 ---
> > 1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> > index abc8e41d6652..110bc5a58862 100644
> > --- a/drivers/gpu/drm/drm_gem.c
> > +++ b/drivers/gpu/drm/drm_gem.c
> > @@ -1067,9 +1067,6 @@ int drm_gem_change_handle_ioctl(struct drm_device
> > *dev, void *data,
> >
> > spin_unlock(&file_priv->table_lock);
> >
> > - if (ret < 0)
> > - goto out_unlock;
> > -
> > if (obj->dma_buf) {
> > ret = drm_prime_add_buf_handle(&file_priv->prime, obj->dma_buf,
> > handle);
> > --
> > 2.53.0
> >