[PATCH] drm/amd/amdkfd: fix possible memory leak in svm_range_restore_pages

2021-09-09 Thread Xiyu Yang
to label "out", in which kfd_unref_process() decreases the refcount. Signed-off-by: Xiyu Yang Signed-off-by: Xin Xiong Signed-off-by: Xin Tan --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm

[PATCH] fbmem: Convert from atomic_t to refcount_t on fb_info->count

2021-07-19 Thread Xiyu Yang
refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan --- drivers/video/fbdev/core/fbmem.c | 6 +++--- include/linux/fb.h | 3 ++- 2 files changed

[PATCH] drm/exynos: Convert from atomic_t to refcount_t on g2d_cmdlist_userptr->refcount

2021-07-19 Thread Xiyu Yang
refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions

[PATCH] drm/i915/gvt: Convert from atomic_t to refcount_t on intel_vgpu_ppgtt_spt->refcount

2021-07-17 Thread Xiyu Yang
refcount_t type and corresponding API can protect refcounters from accidental underflow and overflow and further use-after-free situations Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan --- drivers/gpu/drm/i915/gvt/gtt.c | 11 ++- drivers/gpu/drm/i915/gvt/gtt.h | 3 ++- 2 files

[PATCH] drm/ttm: Fix dma_fence refcnt leak when adding move fence

2020-06-15 Thread Xiyu Yang
pu flag is equals to true. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan --- drivers/gpu/drm/ttm/ttm_bo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index f73b81c2576e..0f20e14a4cfd 100644 --- a/drivers/

[PATCH] drm/ttm: Fix dma_fence refcnt leak in ttm_bo_vm_fault_reserved

2020-06-15 Thread Xiyu Yang
ak. Fix this issue by calling dma_fence_put() when no_wait_gpu flag is equals to true. Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan --- drivers/gpu/drm/ttm/ttm_bo_vm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index a43aa7275

[PATCH] drm/amdgpu/display: Fix dc_sink refcnt leak in dc_link_detect_helper

2020-04-23 Thread Xiyu Yang
issue happens in one exception handling path of dc_link_detect_helper(). When alt mode times out, the function forgets to decrease the refcnt increased by dc_sink_retain(), causing a refcnt leak. Fix this issue by calling dc_sink_release() when alt mode times out. Signed-off-by: Xiyu Yang Signed-off-by: X

[PATCH] drm/amdgpu/display: Fix dc_sink refcnt leak when detecting link

2020-04-23 Thread Xiyu Yang
pens in all paths of emulated_link_detect(), which forgets to decrease the refcnt increased by dc_sink_retain(), causing a refcnt leak. Fix this issue by adding a "err_sink_put" label and calling dc_sink_release() before emulated_link_detect() returns. Signed-off-by: Xiyu Yang Signed-off

[PATCH] drm/i915/selftests: Fix i915_address_space refcnt leak

2020-04-20 Thread Xiyu Yang
"out_vm" label when i915_gem_object_create_internal() returns IS_ERR. Fixes: 4049866f0913 ("drm/i915/selftests: huge page tests") Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan --- drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 12 1 file changed, 8 insertions(+), 4 deletions(-