[PATCH 2/3] drm/xe: Remove unrequired NULL checks in xe_sync_entry_cleanup

Matthew Brost matthew.brost at intel.com
Tue Aug 20 16:05:20 UTC 2024


On Tue, Aug 20, 2024 at 02:32:29PM +0530, Himal Prasad Ghimiray wrote:
> dma_fence_put() and dma_fence_chain_free() can handle NULL input,
> there is no need for NULL check by caller.
> 
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>

Reviewed-by: Matthew Brost <matthew.brost at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_sync.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c
> index a0675f57a398..436faff09bac 100644
> --- a/drivers/gpu/drm/xe/xe_sync.c
> +++ b/drivers/gpu/drm/xe/xe_sync.c
> @@ -249,10 +249,8 @@ void xe_sync_entry_cleanup(struct xe_sync_entry *sync)
>  {
>  	if (sync->syncobj)
>  		drm_syncobj_put(sync->syncobj);
> -	if (sync->fence)
> -		dma_fence_put(sync->fence);
> -	if (sync->chain_fence)
> -		dma_fence_chain_free(sync->chain_fence);
> +	dma_fence_put(sync->fence);
> +	dma_fence_chain_free(sync->chain_fence);
>  	if (sync->ufence)
>  		user_fence_put(sync->ufence);
>  }
> -- 
> 2.34.1
> 


More information about the Intel-xe mailing list