Commit f025a2b8 authored by Sunil Khatri's avatar Sunil Khatri Committed by Alex Deucher
Browse files

drm/amdgpu: clean up the amdgpu_cs_parser_bos



In low memory conditions, kmalloc can fail. In such conditions
unlock the mutex for a clean exit.

We do not need to amdgpu_bo_list_put as it's been handled in the
amdgpu_cs_parser_fini.

Fixes: 737da536 ("drm/amdgpu: update the functions to use amdgpu version of hmm")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202602030017.7E0xShmH-lkp@intel.com/


Signed-off-by: default avatarSunil Khatri <sunil.khatri@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3b948dd0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -892,8 +892,10 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
		struct amdgpu_bo *bo = e->bo;

		e->range = amdgpu_hmm_range_alloc(NULL);
		if (unlikely(!e->range))
			return -ENOMEM;
		if (unlikely(!e->range)) {
			r = -ENOMEM;
			goto out_free_user_pages;
		}

		r = amdgpu_ttm_tt_get_user_pages(bo, e->range);
		if (r)