Public

> -----Original Message-----
> From: Wentao Liang <[email protected]>
> Sent: Wednesday, September 16, 2026 3:42 AM
> To: Kuehling, Felix <[email protected]>
> Cc: [email protected]; Deucher, Alexander <[email protected]>;
> [email protected]; Koenig, Christian
> <[email protected]>; Yat Sin, David <[email protected]>; dri-
> [email protected]; [email protected]; Bhardwaj,
> Rajneesh <[email protected]>; [email protected]; Wentao Liang
> <[email protected]>; [email protected]
> Subject: [PATCH] drm/amdkfd: Fix file reference leak in criu_restore_devices()
>
> In criu_restore_devices(), drm_file is obtained using fget(drm_fd). If
> pdd->drm_file is already set, the function returns -EINVAL without
> releasing the acquired reference via fput(drm_file), leading to a file 
> reference
> count leak.
>
> Fix this by adding fput(drm_file) before returning -EINVAL.
>
> Fixes: bef153b70c6e ("drm/amdkfd: CRIU implement gpu_id remapping")
> Cc: [email protected]
> Signed-off-by: Wentao Liang <[email protected]>

This was already fixed.

Alex

> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 03b266b26738..5453fa4ce4fd 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -2311,6 +2311,7 @@ static int criu_restore_devices(struct kfd_process
> *p,
>               }
>
>               if (pdd->drm_file) {
> +                     fput(drm_file);
>                       ret = -EINVAL;
>                       goto exit;
>               }
> --
> 2.34.1

Reply via email to