[PATCH] drm: nouveau: move bounds checking to the front in nouveau_svm_fault_buffer_dtor()

2022-09-14 Thread Hangyu Hua
It is better to check i before use it in array to avoid potential out of bound access. Signed-off-by: Hangyu Hua --- drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau

[PATCH RESEND] drm: i915: fix a possible refcount leak in intel_dp_add_mst_connector()

2022-06-23 Thread Hangyu Hua
If drm_connector_init fails, intel_connector_free will be called to take care of proper free. So it is necessary to drop the refcount of port before intel_connector_free. Fixes: 091a4f91942a ("drm/i915: Handle drm-layer errors in intel_dp_add_mst_connector") Signed-off-by: Hangyu Hua

Re: [PATCH] drm: bridge: sii8620: fix possible off-by-one

2022-06-22 Thread Hangyu Hua
On 2022/5/18 15:57, Andrzej Hajda wrote: On 18.05.2022 08:58, Hangyu Hua wrote: The next call to sii8620_burst_get_tx_buf will result in off-by-one When ctx->burst.tx_count + size == ARRAY_SIZE(ctx->burst.tx_buf). The same thing happens in sii8620_burst_get_rx_buf. This patch also

Re: [PATCH] drm: i915: fix a possible refcount leak in intel_dp_add_mst_connector()

2022-06-22 Thread Hangyu Hua
On 2022/5/16 15:19, Hangyu Hua wrote: If drm_connector_init fails, intel_connector_free will be called to take care of proper free. So it is necessary to drop the refcount of port before intel_connector_free. Fixes: 091a4f91942a ("drm/i915: Handle drm-layer errors in intel_dp_add_mst_conn

Re: [PATCH] gpu: drm: fix possible memory leak in drm_addmap_core()

2022-06-22 Thread Hangyu Hua
On 2022/5/23 09:57, Hangyu Hua wrote: On 2022/5/9 13:44, Hangyu Hua wrote: map->handle need to be handled correctly when map->type is _DRM_SHM or _DRM_CONSISTENT just like map->type is _DRM_REGISTERS. Fixes: 8d153f7107ff ("drm: update user token hashing and map handles") Si

Re: [PATCH] drm: msm: fix possible memory leak in mdp5_crtc_cursor_set()

2022-05-22 Thread Hangyu Hua
On 2022/5/9 14:11, Hangyu Hua wrote: drm_gem_object_lookup will call drm_gem_object_get inside. So cursor_bo needs to be put when msm_gem_get_and_pin_iova fails. Fixes: e172d10a9c4a ("drm/msm/mdp5: Add hardware cursor support") Signed-off-by: Hangyu Hua --- drivers/gpu/drm/msm

Re: [PATCH] gpu: drm: fix possible memory leak in drm_addmap_core()

2022-05-22 Thread Hangyu Hua
On 2022/5/9 13:44, Hangyu Hua wrote: map->handle need to be handled correctly when map->type is _DRM_SHM or _DRM_CONSISTENT just like map->type is _DRM_REGISTERS. Fixes: 8d153f7107ff ("drm: update user token hashing and map handles") Signed-off-by: Hangyu Hua --- drivers

[PATCH] drm: bridge: sii8620: fix possible off-by-one

2022-05-17 Thread Hangyu Hua
It is unreasonable to check tx_buf's size and use rx_buf. Fixes: e19e9c692f81 ("drm/bridge/sii8620: add support for burst eMSC transmissions") Signed-off-by: Hangyu Hua --- drivers/gpu/drm/bridge/sil-sii8620.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH] drm: i915: fix a possible refcount leak in intel_dp_add_mst_connector()

2022-05-16 Thread Hangyu Hua
If drm_connector_init fails, intel_connector_free will be called to take care of proper free. So it is necessary to drop the refcount of port before intel_connector_free. Fixes: 091a4f91942a ("drm/i915: Handle drm-layer errors in intel_dp_add_mst_connector") Signed-off-by:

[PATCH] drm: dp: fix a possible memory leak in fetch_monitor_name()

2022-05-15 Thread Hangyu Hua
drm_dp_mst_get_edid call kmemdup to create mst_edid. So mst_edid need to be freed after use. Signed-off-by: Hangyu Hua --- drivers/gpu/drm/dp/drm_dp_mst_topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/dp/drm_dp_mst_topology.c b/drivers/gpu/drm/dp

[PATCH] drm: msm: fix possible memory leak in mdp5_crtc_cursor_set()

2022-05-08 Thread Hangyu Hua
drm_gem_object_lookup will call drm_gem_object_get inside. So cursor_bo needs to be put when msm_gem_get_and_pin_iova fails. Fixes: e172d10a9c4a ("drm/msm/mdp5: Add hardware cursor support") Signed-off-by: Hangyu Hua --- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 +++- 1 file

[PATCH] gpu: drm: fix possible memory leak in drm_addmap_core()

2022-05-08 Thread Hangyu Hua
map->handle need to be handled correctly when map->type is _DRM_SHM or _DRM_CONSISTENT just like map->type is _DRM_REGISTERS. Fixes: 8d153f7107ff ("drm: update user token hashing and map handles") Signed-off-by: Hangyu Hua --- drivers/gpu/drm/drm_bufs.c | 18 +++

Re: [PATCH] gpu: drm: remove redundant dma_fence_put() when drm_sched_job_add_dependency() fails

2022-04-28 Thread Hangyu Hua
On 2022/4/28 23:27, Andrey Grodzovsky wrote: On 2022-04-28 04:56, Hangyu Hua wrote: On 2022/4/27 22:43, Andrey Grodzovsky wrote: On 2022-04-26 22:31, Hangyu Hua wrote: On 2022/4/26 22:55, Andrey Grodzovsky wrote: On 2022-04-25 22:54, Hangyu Hua wrote: On 2022/4/25 23:42, Andrey

Re: [PATCH] gpu: drm: remove redundant dma_fence_put() when drm_sched_job_add_dependency() fails

2022-04-28 Thread Hangyu Hua
On 2022/4/27 22:43, Andrey Grodzovsky wrote: On 2022-04-26 22:31, Hangyu Hua wrote: On 2022/4/26 22:55, Andrey Grodzovsky wrote: On 2022-04-25 22:54, Hangyu Hua wrote: On 2022/4/25 23:42, Andrey Grodzovsky wrote: On 2022-04-25 04:36, Hangyu Hua wrote: When drm_sched_job_add_dependency

Re: [PATCH] gpu: drm: remove redundant dma_fence_put() when drm_sched_job_add_dependency() fails

2022-04-26 Thread Hangyu Hua
On 2022/4/26 22:55, Andrey Grodzovsky wrote: On 2022-04-25 22:54, Hangyu Hua wrote: On 2022/4/25 23:42, Andrey Grodzovsky wrote: On 2022-04-25 04:36, Hangyu Hua wrote: When drm_sched_job_add_dependency() fails, dma_fence_put() will be called internally. Calling it again after

Re: [PATCH] gpu: drm: remove redundant dma_fence_put() when drm_sched_job_add_dependency() fails

2022-04-25 Thread Hangyu Hua
On 2022/4/25 23:42, Andrey Grodzovsky wrote: On 2022-04-25 04:36, Hangyu Hua wrote: When drm_sched_job_add_dependency() fails, dma_fence_put() will be called internally. Calling it again after drm_sched_job_add_dependency() finishes may result in a dangling pointer. Fix this by removing

[PATCH] gpu: drm: remove redundant dma_fence_put() when drm_sched_job_add_dependency() fails

2022-04-25 Thread Hangyu Hua
When drm_sched_job_add_dependency() fails, dma_fence_put() will be called internally. Calling it again after drm_sched_job_add_dependency() finishes may result in a dangling pointer. Fix this by removing redundant dma_fence_put(). Signed-off-by: Hangyu Hua --- drivers/gpu/drm/lima/lima_gem.c