[PATCH 1/1] drm/atomic: put state on error path

2021-01-21 Thread Pan Bian
Put the state before returning error code. Fixes: 44596b8c4750 ("drm/atomic: Unify conflicting encoder handling.") Signed-off-by: Pan Bian --- drivers/gpu/drm/drm_atomic_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c

[PATCH] drm/imx: fix memory leak when fails to init

2021-01-21 Thread Pan Bian
Put DRM device on initialization failure path rather than directly return error code. Fixes: a67d5088ceb8 ("drm/imx: drop explicit drm_mode_config_cleanup") Signed-off-by: Pan Bian --- drivers/gpu/drm/imx/imx-drm-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] drm/i915/selftest: Fix potential memory leak

2021-01-22 Thread Pan Bian
Object out is not released on path that no VMA instance found. The root cause is jumping to an unexpected label on the error path. Fixes: a47e788c2310 ("drm/i915/selftests: Exercise CS TLB invalidation") Signed-off-by: Pan Bian --- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2

[PATCH] drm/amdgpu: fix double reference dropping

2019-11-06 Thread Pan Bian
After dropping the reference of object fence in the loop, it should be set to NULL to protecting dropping its reference again outside the loop. Signed-off-by: Pan Bian --- drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd

[PATCH] drm/amdgpu: fix potential double drop fence reference

2019-11-06 Thread Pan Bian
The object fence is not set to NULL after its reference is dropped. As a result, its reference may be dropped again if error occurs after that, which may lead to a use after free bug. To avoid the issue, fence is explicitly set to NULL after dropping its reference. Signed-off-by: Pan Bian

[PATCH] drm/i915/gvt: fix dropping obj reference twice

2019-11-06 Thread Pan Bian
The reference count of obj will be decremented twice if error occurs in dma_buf_fd(). Additionally, attempting to read the reference count of obj after dropping reference may lead to a use after free bug. Here, we drop obj's reference until it is not used. Signed-off-by: Pan Bian --- dr

[PATCH v2] drm/amdgpu: fix double reference dropping

2019-11-06 Thread Pan Bian
The reference to object fence is dropped at the end of the loop. However, it is dropped again outside the loop. The reference can be dropped immediately after calling dma_fence_wait() in the loop and thus the dropping operation outside the loop can be removed. Signed-off-by: Pan Bian --- v2: fix

[PATCH 1/1] drm/radeon: check return value of radeon_ring_lock

2017-04-23 Thread Pan Bian
From: Pan Bian Function radeon_ring_lock() returns an errno on failure, and its return value should be validated. However, in functions r420_cp_errata_init() and r420_cp_errata_fini(), its return value is not checked. This patch adds the checks. Signed-off-by: Pan Bian --- drivers/gpu/drm

[PATCH 1/1] drm/radeon: check return vlaue of radeon_fence_emit

2017-04-23 Thread Pan Bian
From: Pan Bian Function radeon_fence_emit() returns -ENOMEM if there is no enough memory. And in this case, function radeon_ring_unlock_undo() rather than function radeon_ring_unlock_commit() should be called. However, in function radeon_test_create_and_emit_fence(), the return value of

[PATCH 1/1] drm/radeon: check return value of radeon_ring_lock

2017-04-24 Thread Pan Bian
From: Pan Bian Function radeon_ring_lock() returns an errno on failure, and its return value should be validated. However, in functions r420_cp_errata_init() and r420_cp_errata_fini(), its return value is not checked. This patch adds the checks. Signed-off-by: Pan Bian --- drivers/gpu/drm

[PATCH 1/1] drm/radeon: check return value of radeon_fence_emit

2017-04-24 Thread Pan Bian
From: Pan Bian Function radeon_fence_emit() returns -ENOMEM if there is no enough memory. And in this case, function radeon_ring_unlock_undo() rather than function radeon_ring_unlock_commit() should be called. However, in function radeon_test_create_and_emit_fence(), the return value of

[PATCH 1/1] gpu: drm: qxl: fix use of uninitialized variable

2016-12-03 Thread Pan Bian
"-ENOMEM" when kmalloc() fails. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188911 Signed-off-by: Pan Bian --- drivers/gpu/drm/qxl/qxl_release.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl

[PATCH 1/1] dri: vc4: set error code on failure

2016-12-03 Thread Pan Bian
kernel.org/show_bug.cgi?id=188631 Signed-off-by: Pan Bian --- drivers/gpu/drm/vc4/vc4_gem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c index 47a095f..2592a94 100644 --- a/drivers/gpu/drm/vc4/vc4_gem.c +++ b/drivers/gpu/drm/vc4

gma500: mmu: unmap the correct address

2017-10-30 Thread Pan Bian
The function kunmap_atomatic() is called on the same variable twice, i.e. pt->v. In the second call, its parameter should be variable v rather than pt->v. Signed-off-by: Pan Bian --- drivers/gpu/drm/gma500/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/g