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]>

> 
> 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
> 

Reply via email to