Re: [Freedreno] [PATCH 01/10] Revert "drm/msm: Add missing check and destroy for alloc_ordered_workqueue"

2023-03-07 Thread Jiasheng Jiang
On Mon, 06 Mar 2023 18:07:13 +0800, Johan Hovold wrote: > This reverts commit 643b7d0869cc7f1f7a5ac7ca6bd25d88f54e31d0. The commit not only adds the allocation sanity check, but also adds the destroy_workqueue to release the allocated priv->wq. Therefore, revert the commit will cause memory leak.

[Freedreno] [PATCH v2] drm/msm/dsi: Drop the redundant fail label

2023-01-10 Thread Jiasheng Jiang
Drop the redundant fail label and change the "goto fail" into "return ret" since they are the same. Reviewed-by: Doug Anderson Signed-off-by: Jiasheng Jiang --- Changelog: v1 -> v2: 1. No change of the error handling of the irq_of_parse_and_map. --- drivers/gpu/drm/

[Freedreno] [PATCH] drm/msm/dsi: Drop the redundant fail label

2023-01-09 Thread Jiasheng Jiang
Drop the redundant fail label and change the "goto fail" into "return ret" since they are the same. Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/msm/dsi/dsi_host.c | 27 +-- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/dri

[Freedreno] [PATCH v3] drm/msm/dsi: Add missing check for alloc_ordered_workqueue

2023-01-09 Thread Jiasheng Jiang
Add check for the return value of alloc_ordered_workqueue as it may return NULL pointer and cause NULL pointer dereference. Signed-off-by: Jiasheng Jiang --- Changelog: v2 -> v3: 1. Simply return -ENOMEM instead of using ret. 2. No change of the "goto fail". v1 -> v2: 1.

[Freedreno] [PATCH v2] drm/msm/dsi: Add missing check for alloc_ordered_workqueue

2023-01-08 Thread Jiasheng Jiang
Add check for the return value of alloc_ordered_workqueue as it may return NULL pointer and cause NULL pointer dereference. Moreover, change the "goto fail" into "return ret" and drop the "fail" label since they are the same. Signed-off-by: Jiasheng Jiang --- Change

[Freedreno] [PATCH v2] drm/msm: Add missing check and destroy for alloc_ordered_workqueue

2023-01-08 Thread Jiasheng Jiang
Add check for the return value of alloc_ordered_workqueue as it may return NULL pointer. Moreover, use the destroy_workqueue in the later fails in order to avoid memory leak. Signed-off-by: Jiasheng Jiang --- Changelog: v1 -> v2: 1. Convert "goto err_destroy_workqueue" into "

[Freedreno] [PATCH RESEND] drm/msm: Add missing check and destroy for alloc_ordered_workqueue

2023-01-06 Thread Jiasheng Jiang
Add check for the return value of alloc_ordered_workqueue as it may return NULL pointer. Moreover, use the destroy_workqueue in the later fails in order to avoid memory leak. Fixes: c8afe684c95c ("drm/msm: basic KMS driver for snapdragon") Signed-off-by: Jiasheng Jiang --- drivers/g

[Freedreno] [PATCH] drm/msm/dsi: Add missing check for alloc_ordered_workqueue

2023-01-05 Thread Jiasheng Jiang
connector support") Fixes: 32d3e0feccfe ("drm/msm: dsi: Use OPP API to set clk/perf state") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/msm/dsi/dsi_host.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/

[Freedreno] [PATCH] drm/msm/hdmi: Add missing check for alloc_ordered_workqueue

2023-01-05 Thread Jiasheng Jiang
Add check for the return value of alloc_ordered_workqueue as it may return NULL pointer and cause NULL pointer dereference in `hdmi_hdcp.c` and `hdmi_hpd.c`. Fixes: c6a57a50ad56 ("drm/msm/hdmi: add hdmi hdcp support (V3)") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/msm/hdmi/

[Freedreno] [PATCH] drm/msm/gem: Add check for kmalloc

2022-12-12 Thread Jiasheng Jiang
Add the check for the return value of kmalloc in order to avoid NULL pointer dereference in copy_from_user. Fixes: 20224d715a88 ("drm/msm/submit: Move copy_from_user ahead of locking bos") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/msm/msm_gem_submit.c | 4 1 file

[Freedreno] [PATCH] drm/msm/dpu: Add check for cstate

2022-12-06 Thread Jiasheng Jiang
As kzalloc may fail and return NULL pointer, it should be better to check cstate in order to avoid the NULL pointer dereference in __drm_atomic_helper_crtc_reset. Fixes: 1cff7440a86e ("drm/msm: Convert to using __drm_atomic_helper_crtc_reset() for reset.") Signed-off-by: Jias

[Freedreno] [PATCH] drm/msm/dpu: Add check for pstates

2022-12-06 Thread Jiasheng Jiang
As kzalloc may fail and return NULL pointer, it should be better to check pstates in order to avoid the NULL pointer dereference. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 ++ 1 file

[Freedreno] [PATCH] drm/msm/dpu: Add check for cstate

2022-12-06 Thread Jiasheng Jiang
As kzalloc may fail and return NULL pointer, it should be better to check pstates in order to avoid the NULL pointer dereference later. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 ++ 1 file

[Freedreno] [PATCH] drm/msm/mdp5: Add check for kzalloc

2022-12-05 Thread Jiasheng Jiang
As kzalloc may fail and return NULL pointer, it should be better to check the return value in order to avoid the NULL pointer dereference. Fixes: 1cff7440a86e ("drm/msm: Convert to using __drm_atomic_helper_crtc_reset() for reset.") Signed-off-by: Jiasheng Jiang --- drivers/gpu/dr

[Freedreno] [PATCH] drm/msm/mdp5: Add check for kzalloc

2022-12-05 Thread Jiasheng Jiang
As kzalloc may fail and return NULL pointer, it should be better to check the return value in order to avoid the NULL pointer dereference. Fixes: 1cff7440a86e ("drm/msm: Convert to using __drm_atomic_helper_crtc_reset() for reset.") Signed-off-by: Jiasheng Jiang --- drivers/gpu/dr