Re: [Nouveau] [PATCH] drm/nouveau/nouveau_bo: fix potential memory leak in nouveau_bo_alloc()

2022-07-07 Thread Lyude Paul
Reviewed-by: Lyude Paul Will push On Tue, 2022-07-05 at 17:43 +0800, Jianglei Nie wrote: > nouveau_bo_alloc() allocates a memory chunk for "nvbo" with kzalloc(). > When some error occurs, "nvbo" should be released. But when > WARN_ON(pi < 0)) equals true, the function return ERR_PTR without >

Re: [Nouveau] [PATCH] drm/nouveau: fix a use-after-free in nouveau_gem_prime_import_sg_table()

2022-07-07 Thread Lyude Paul
Reviewed-by: Lyude Paul Will push to the appropriate branch in a moment On Tue, 2022-07-05 at 21:25 +0800, Jianglei Nie wrote: > nouveau_bo_init() is backed by ttm_bo_init() and ferries its return code > back to the caller. On failures, ttm will call nouveau_bo_del_ttm() and > free the

Re: [Nouveau] [Intel-gfx] [PATCH 1/6] drm/ttm: rename and cleanup ttm_bo_init_reserved

2022-07-07 Thread kernel test robot
Hi "Christian, I love your patch! Perhaps something to improve: [auto build test WARNING on drm-tip/drm-tip] url: https://github.com/intel-lab-lkp/linux/commits/Christian-K-nig/drm-ttm-rename-and-cleanup-ttm_bo_init_reserved/20220707-192538 base: git://anongit.freedesktop.org/drm/dr

[Nouveau] [PATCH 5/6] drm/ttm: stop allocating dummy resources during BO creation

2022-07-07 Thread Christian König
That should not be necessary any more when drivers should at least be able to handle the move without a resource. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c

[Nouveau] [PATCH 2/6] drm/amdgpu: audit bo->resource usage

2022-07-07 Thread Christian König
Make sure we can at least move and release BOs without backing store. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c| 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git

[Nouveau] [PATCH 6/6] drm/ttm: stop allocating a dummy resource for pipelined gutting

2022-07-07 Thread Christian König
That should not be necessary any more when drivers should at least be able to handle a move without a resource. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo_util.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git

[Nouveau] [PATCH 4/6] drm/ttm: audit bo->resource usage v2

2022-07-07 Thread Christian König
Allow BOs to exist without backing store. v2: handle ttm_bo_move_memcpy as well. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 16 drivers/gpu/drm/ttm/ttm_bo_util.c | 7 +-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git

[Nouveau] [PATCH 3/6] drm/nouveau: audit bo->resource usage

2022-07-07 Thread Christian König
Make sure we can at least move and release BOs without backing store. Signed-off-by: Christian König --- drivers/gpu/drm/nouveau/nouveau_bo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index

[Nouveau] Cleanup of TTM NULL resources

2022-07-07 Thread Christian König
Hi guys, sending this out once more since it was requested that the Intel CI systems can take a run of this as well. The last version had a couple of merge/rebase leftovers which are now fixed as well. Please review and/or comment, Christian.

[Nouveau] [PATCH 1/6] drm/ttm: rename and cleanup ttm_bo_init_reserved

2022-07-07 Thread Christian König
Rename ttm_bo_init_reserved to ttm_bo_init_validate since that better matches what the function is actually doing. Remove the unused size parameter, move the function's kerneldoc to the implementation and cleanup the whole error handling. Signed-off-by: Christian König ---