[PATCH RESEND v2] drm/i915: Fix memory leak by correcting cache object name in error handler

2024-11-27 Thread Jiasheng Jiang
From: Jiasheng Jiang Replace "slab_priorities" with "slab_dependencies" in the error handler to avoid memory leak. Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") Cc: # v5.2+ Reviewed-by: Nirmoy Das Signed-off-by: Jiasheng Jiang --- Chang

[PATCH v2] drm/i915: Fix memory leak by correcting cache object name in error handler

2024-05-13 Thread Jiasheng Jiang
Replace "slab_priorities" with "slab_dependencies" in the error handler to avoid memory leak. Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") Cc: # v5.2+ Reviewed-by: Nirmoy Das Signed-off-by: Jiasheng Jiang --- Changelog: v1 -> v2: 1

[PATCH v2] drm/i915: Fix memory leak by correcting cache object name in error handler

2024-05-13 Thread Jiasheng Jiang
Replace "slab_priorities" with "slab_dependencies" in the error handler to avoid memory leak. Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") Signed-off-by: Jiasheng Jiang --- Changelog: v1 -> v2: 1. Alter the subject. --- drivers/

[PATCH] drm/i915: Correct error handler

2024-05-13 Thread Jiasheng Jiang
> On 5/11/2024 5:48 PM, Jiasheng Jiang wrote: >> Replace "slab_priorities" with "slab_dependencies" in the error handler to >> avoid memory leak. > > Nice catch. I would make the subject more like: > > drm/i915: Fix memory leak by correcting ca

[PATCH] drm/i915: Correct error handler

2024-05-13 Thread Jiasheng Jiang
> On 5/11/2024 5:48 PM, Jiasheng Jiang wrote: >> Replace "slab_priorities" with "slab_dependencies" in the error handler to >> avoid memory leak. > > Nice catch. I would make the subject more like: > > drm/i915: Fix memory leak by correcting ca

[PATCH] drm/i915: Correct error handler

2024-05-11 Thread Jiasheng Jiang
Replace "slab_priorities" with "slab_dependencies" in the error handler to avoid memory leak. Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/i915/i915_scheduler.c | 2 +- 1 file chang

[PATCH] drm/i915: Correct error handler

2024-05-11 Thread Jiasheng Jiang
From: Jiasheng Jiang Replace "slab_priorities" with "slab_dependencies" in the error handler to avoid memory leak. Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/i915/i915_schedul

Re: [PATCH] drm/i915: Correct error handler

2024-05-11 Thread Jiasheng Jiang
Maybe the format is incorrect. I would like to use "jiashengjiangc...@outlook.com" to resend my patch. -Jiasheng ____ From: Jiasheng Jiang Sent: Saturday, May 11, 2024 3:40 To: jani.nik...@linux.intel.com; joonas.lahti...@linux.intel.com;

[PATCH] drm/i915: Correct error handler

2024-05-10 Thread Jiasheng Jiang
Replace "slab_priorities" with "slab_dependencies" in the error handler to avoid memory leak. Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/i915/i915_scheduler.c | 2 +- 1 file changed, 1 ins

[PATCH] drm/i915: Correct error handler

2024-05-10 Thread Jiasheng Jiang
Replace "slab_priorities" with "slab_dependencies" in the error handler to avoid memory leak. Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/i915/i915_scheduler.c | 2 +- 1 file chang

[PATCH] drm/i915/gem: Add check for bitmap_zalloc()

2023-07-27 Thread Jiasheng Jiang
Add the check for the return value of bitmap_zalloc() in order to guarantee the success of the allocation. Fixes: e9b73c67390a ("drm/i915: Reduce memory pressure during shrinker by preallocating swizzle pages") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/i915/gem/i915_gem_ti

[PATCH] drm: xlnx: zynqmp_dpsub: Add missing check for dma_set_mask

2023-06-06 Thread Jiasheng Jiang
Add check for dma_set_mask() and return the error if it fails. Fixes: d76271d22694 ("drm: xlnx: DRM/KMS driver for Xilinx ZynqMP DisplayPort Subsystem") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) di

Re: [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.

Re: [PATCH 1/2] drm: Add DRM-managed alloc_workqueue() and alloc_ordered_workqueue()

2023-01-17 Thread Jiasheng Jiang
> On Tue, Jan 10, 2023 at 11:24:47PM +0800, Jiasheng Jiang wrote: >> Add drmm_alloc_workqueue() and drmm_alloc_ordered_workqueue(), the helpers >> that provide managed workqueue cleanup. The workqueue will be destroyed >> with the final reference of the DRM device. >>

[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/

[PATCH 2/2 v2] drm/i915: Replace alloc*workqueue with DRM helpers

2023-01-10 Thread Jiasheng Jiang
the return value since the workqueue may be NULL and cause NULL pointer dereference. Fixes: c26a058680dc ("drm/i915: Use a high priority wq for nonblocking plane updates") Fixes: 757fffcfdffb ("drm/i915: Put all non-blocking modesets onto an ordered wq") Signed-of

Re: [PATCH] drm/i915: Add missing check and destroy for alloc_workqueue

2023-01-10 Thread Jiasheng Jiang
On Sat, Jan 07, 2023 at 02:29:22AM +0800, Daniel Vetter wrote: >On Fri, Jan 06, 2023 at 05:09:34PM +0800, Jiasheng Jiang wrote: >> Add checks for the return value of alloc_workqueue and >> alloc_ordered_workqueue as they may return NULL pointer and cause NULL >> pointer der

[PATCH 2/2] drm/i915: Replace alloc*workqueue with DRM helpers

2023-01-10 Thread Jiasheng Jiang
t;drm/i915: Put all non-blocking modesets onto an ordered wq") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/i915/display/intel_display.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/

[PATCH 1/2] drm: Add DRM-managed alloc_workqueue() and alloc_ordered_workqueue()

2023-01-10 Thread Jiasheng Jiang
Add drmm_alloc_workqueue() and drmm_alloc_ordered_workqueue(), the helpers that provide managed workqueue cleanup. The workqueue will be destroyed with the final reference of the DRM device. Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/drm_managed.c | 66

[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

[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.

[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

[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 "

[PATCH] drm/i915: Add missing check and destroy for alloc_workqueue

2023-01-06 Thread Jiasheng Jiang
fails, its workqueues will not be destroyed. Fixes: c26a058680dc ("drm/i915: Use a high priority wq for nonblocking plane updates") Fixes: 757fffcfdffb ("drm/i915: Put all non-blocking modesets onto an ordered wq") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/i915/display/

[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

[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/

[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/

[PATCH] drm/msm: Add missing check and destroy 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. 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

Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent

2022-12-23 Thread Jiasheng Jiang
On Fri, Dec 23, 2022 at 10:54:37PM +0800, Greg KH wrote: >> diff --git a/drivers/usb/gadget/udc/aspeed_udc.c >> b/drivers/usb/gadget/udc/aspeed_udc.c >> index 01968e2167f9..7dc2457c7460 100644 >> --- a/drivers/usb/gadget/udc/aspeed_udc.c >> +++ b/drivers/usb/gadget/udc/aspeed_udc.c >> @@ -1516,6 +

Re: [PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent

2022-12-23 Thread Jiasheng Jiang
Yes, it is the same as mine. As the previous patch had not been merged into the Linux kernel, my tool found the same error and report it. And both of us chose the most concise way to fix the error. That is why the patches are the same. Thanks, Jiang

[PATCH v3] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent

2022-12-15 Thread Jiasheng Jiang
x27;t have a UDC device to test with, no runtime testing was able to be performed. Signed-off-by: Jiasheng Jiang --- Changelog: v2 -> v3: 1. Add information of finding tool and tests to commit message. v1 -> v2: 1. Add "goto err;" when allocation fails. --- drivers/usb/gadget

[PATCH v2] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent

2022-12-13 Thread Jiasheng Jiang
x27;t have a UDC device to test with, no runtime testing was able to be performed. Signed-off-by: Jiasheng Jiang --- Changelog: v1 -> v2: 1. Add "goto err;" when allocation fails. --- drivers/usb/gadget/udc/aspeed_udc.c | 4 1 file changed, 4 insertions(+) diff --git a/driv

[PATCH v2] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent

2022-12-13 Thread Jiasheng Jiang
Add the check for the return value of dma_alloc_coherent in order to avoid NULL pointer dereference. Fixes: 055276c13205 ("usb: gadget: add Aspeed ast2600 udc driver") Signed-off-by: Jiasheng Jiang --- Changelog: v1 -> v2: 1. Add "goto err;" when allocation fails. ---

Re: [PATCH] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent

2022-12-13 Thread Jiasheng Jiang
Thanks, I found my mistake and I will submit a v2. > And how did you find this potential problem? What tool did you use and > why did you not follow the documentation for properly describing the > tool? I used a tool I wrote myself to find it, which is unpublished. Therefore, I think it is okay

[PATCH] usb: gadget: aspeed_udc: Add check for dma_alloc_coherent

2022-12-12 Thread Jiasheng Jiang
Add the check for the return value of dma_alloc_coherent in order to avoid NULL pointer dereference. Fixes: 055276c13205 ("usb: gadget: add Aspeed ast2600 udc driver") Signed-off-by: Jiasheng Jiang --- drivers/usb/gadget/udc/aspeed_udc.c | 2 ++ 1 file changed, 2 insertions(+) di

[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

[PATCH] drm: mali-dp: Add check for kzalloc

2022-12-07 Thread Jiasheng Jiang
s NULL in order to improve the robust. Fixes: 8cbc5caf36ef ("drm: mali-dp: Add writeback connector") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/arm/malidp_mw.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/a

[PATCH] drm: mali-dp: Add check for kzalloc

2022-12-07 Thread Jiasheng Jiang
n order to improve the robust. Fixes: 8cbc5caf36ef ("drm: mali-dp: Add writeback connector") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/arm/malidp_mw.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/a

Re: [PATCH] drm: mali-dp: Add check for kzalloc

2022-12-07 Thread Jiasheng Jiang
On Wed, Dec 07, 2022 at 09:59:04PM +0800, Robin Murphy wrote: >> 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 in >> __drm_atomic_helper_connector_reset. > > This commit message is nonsense; if > __drm_

[PATCH] drm: mali-dp: Add check for kzalloc

2022-12-07 Thread Jiasheng Jiang
s NULL in order to improve the robust. Fixes: 8cbc5caf36ef ("drm: mali-dp: Add writeback connector") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/arm/malidp_mw.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/a

[PATCH] drm/amd/display: Add check for kzalloc

2022-12-07 Thread Jiasheng Jiang
t;) Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 9 ++--- .../gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 6 +- .../gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.h | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) di

[PATCH] drm: mali-dp: Add check for kzalloc

2022-12-07 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 in __drm_atomic_helper_connector_reset. Fixes: 8cbc5caf36ef ("drm: mali-dp: Add writeback connector") Signed-off-by: Jiasheng Jiang --- drivers/g

[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

[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

[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

[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

[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

[PATCH] drm/amd/display: rewrite the check for mods

2022-11-19 Thread Jiasheng Jiang
On Thu, 17 Nov 2022 15:56:09 +0800, Simon Ser wrote: >> @@ -638,11 +638,14 @@ static int get_plane_modifiers(struct amdgpu_device >> *adev, unsigned int plane_ty >> return 0; >> >> *mods = kmalloc(capacity * sizeof(uint64_t), GFP_KERNEL); >> +if (!*mods) >> +ret

[PATCH] drm/amd/display: rewrite the check for mods

2022-11-16 Thread Jiasheng Jiang
When the *mods is NULL, it should be better to return error immediately, rather than continue with redundant operations. Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH] drm/amd/display: Add check for memory allocation

2022-09-26 Thread Jiasheng Jiang
t;) Signed-off-by: Jiasheng Jiang --- .../drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_m

[PATCH 1/2] video: fbdev: gbefb: Convert to use dev_groups

2022-09-01 Thread Jiasheng Jiang
ned-off-by: Jiasheng Jiang --- drivers/video/fbdev/gbefb.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index 6b4d5a7f3e15..1582c718329c 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/v

[PATCH 2/2] video: fbdev: gbefb: Remove unproper information

2022-09-01 Thread Jiasheng Jiang
When drivers are working properly, they are quiet. Therefore, the fb_info() should be removed. Signed-off-by: Jiasheng Jiang --- drivers/video/fbdev/gbefb.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index 1582c718329c

[PATCH v2] drm: bridge: adv7511: Add check for mipi_dsi_driver_register

2022-06-02 Thread Jiasheng Jiang
ned-off-by: Jiasheng Jiang --- Changelog: v1 -> v2 *Change 1. Add the mipi_dsi_driver_unregister if i2c_add_driver fails. --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv

Re: Re: [PATCH] drm: bridge: adv7511: Add check for mipi_dsi_driver_register

2022-06-01 Thread Jiasheng Jiang
On Wed, Jun 01, 2022 at 05:15:37PM +0800, Laurent Pinchart wrote: >> Well, as far as I am concerned, the adv7511_exit() in the same file has >> already dealt with the issue. >> Therefore, it might not be necessary to add another >> mipi_dsi_driver_unregister(). > > The issue is that adv7511_exit

Re: Re: [PATCH] drm: bridge: adv7511: Add check for mipi_dsi_driver_register

2022-06-01 Thread Jiasheng Jiang
On Wed, Jun 01, 2022 at 02:52:00PM +0800, Laurent Pinchart wrote: >> static int __init adv7511_init(void) >> { >> -if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) >> -mipi_dsi_driver_register(&adv7533_dsi_driver); >> +int ret; >> + >> +if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) { >> +

[PATCH] drm: bridge: adv7511: Add check for mipi_dsi_driver_register

2022-05-31 Thread Jiasheng Jiang
As mipi_dsi_driver_register could return error if fails, it should be better to check the return value and return error if fails. Fixes: 1e4d58cd7f88 ("drm/bridge: adv7533: Create a MIPI DSI device") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 9 ++

[PATCH] drm/panel/raspberrypi-touchscreen: Add check for mipi_dsi_driver_register

2022-05-31 Thread Jiasheng Jiang
As mipi_dsi_driver_register could return error if fails, it should be better to check the return value and return error if fails. Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/panel/pa

[PATCH] drm/xlnx: Handle error for dma_set_mask

2022-03-02 Thread Jiasheng Jiang
As the potential failure of the dma_set_mask(), it should be better to check it and return error if fails. Fixes: d76271d22694 ("drm: xlnx: DRM/KMS driver for Xilinx ZynqMP DisplayPort Subsystem") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 4 +++- 1 file

[PATCH] drm/i915/gt: Handle errors for i915_gem_object_trylock

2022-03-01 Thread Jiasheng Jiang
As the potential failure of the i915_gem_object_trylock(), it should be better to check it and return error if fails. Fixes: 94ce0d65076c ("drm/i915/gt: Setup a default migration context on the GT") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/i915/gt/selftest_migrate.c | 6

Re: [PATCH] drm/arm/mali: Check for NULL pointer after calling kzalloc

2022-01-14 Thread Jiasheng Jiang
Sorry, I just noticed that I have already sent the patch before and it has been reviewed. Please ignore this one. Sincerely thanks, Jiang

[PATCH] drm/arm/mali: Check for NULL pointer after calling kzalloc

2022-01-14 Thread Jiasheng Jiang
ead of the '&mw_state->base' and __drm_atomic_helper_connector_reset() will deal with it correctly. Fixes: 8cbc5caf36ef ("drm: mali-dp: Add writeback connector") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/arm/malidp_mw.c | 6 +- 1 file changed, 5 insertions(+), 1 dele

[PATCH] drm/rockchip: Check for NULL pointer after calling kzalloc

2022-01-14 Thread Jiasheng Jiang
mp;crtc_state->base' and __drm_atomic_helper_crtc_duplicate_state() will deal with it correctly. Fixes: dc0b408f5a87 ("drm/rockchip: allocate correct crtc state structure on reset") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 - 1 file

[PATCH v2] drm/v3d/v3d_drv: Check for error num after setting mask

2022-01-09 Thread Jiasheng Jiang
: Set dma_mask as well as coherent_dma_mask") Signed-off-by: Jiasheng Jiang Reviewed-by: Melissa Wen --- Changelog: v1 -> v2 * Change 1. Add a variable for the mask. --- drivers/gpu/drm/v3d/v3d_drv.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/

[PATCH] drm/panfrost: Check for error num after setting mask

2022-01-05 Thread Jiasheng Jiang
Because of the possible failure of the dma_supported(), the dma_set_mask_and_coherent() may return error num. Therefore, it should be better to check it and return the error if fails. Fixes: d9b631f0a0c4 ("drm/panfrost: Set DMA masks earlier") Signed-off-by: Jiasheng Jiang --- drive

[PATCH] drm/v3d/v3d_drv: Check for error num after setting mask

2022-01-05 Thread Jiasheng Jiang
Because of the possible failure of the dma_supported(), the dma_set_mask_and_coherent() may return error num. Therefore, it should be better to check it and return the error if fails. Fixes: 334dd38a3878 ("drm/v3d: Set dma_mask as well as coherent_dma_mask") Signed-off-by: Jias

[PATCH] misc: fastrpc: Check for error num after setting mask

2022-01-05 Thread Jiasheng Jiang
Because of the possible failure of the dma_supported(), the dma_set_mask_and_coherent() may return error num. Therefore, it should be better to check it and return the error if fails. Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model") Signed-off-by: Jias

[PATCH] drm/amdkfd: Check for null pointer after calling kmemdup

2022-01-05 Thread Jiasheng Jiang
As the possible failure of the allocation, kmemdup() may return NULL pointer. Therefore, it should be better to check the 'props2' in order to prevent the dereference of NULL pointer. Fixes: 3a87177eb141 ("drm/amdkfd: Add topology support for dGPUs") Signed-off-by: Jiasheng

[PATCH] drm/imx: imx-ldb: Check for null pointer after calling kmemdup

2022-01-04 Thread Jiasheng Jiang
As the possible failure of the allocation, kmemdup() may return NULL pointer. Therefore, it should be better to check the return value of kmemdup() and return error if fails. Fixes: dc80d7038883 ("drm/imx-ldb: Add support to drm-bridge") Signed-off-by: Jiasheng Jiang --- drivers/gpu/d

[PATCH v2] video: fbdev: Check for null res pointer

2021-12-20 Thread Jiasheng Jiang
The return value of platform_get_resource() needs to be checked. To avoid use of error pointer in case that there is no suitable resource. Fixes: f7018c213502 ("video: move fbdev to drivers/video/fbdev") Signed-off-by: Jiasheng Jiang --- Changelog: v1 -> v2 *Change 1. Corre

[PATCH] video: fbdev: Check for null res pointer

2021-12-19 Thread Jiasheng Jiang
The return value of platform_get_resource() needs to be checked. To avoid use of error pointer in case of the failure of alloc. Fixes: f7018c213502 ("video: move fbdev to drivers/video/fbdev") Signed-off-by: Jiasheng Jiang --- drivers/video/fbdev/imxfb.c | 2 ++ 1 file changed, 2

[PATCH] drm/amdgpu: potential dereference of null pointer

2021-12-16 Thread Jiasheng Jiang
The return value of dma_alloc_coherent() needs to be checked. To avoid use of null pointer in memcpy_toio() in case of the failure of alloc. Fixes: 57430471e2fa ("drm/amdgpu: Add support for USBC PD FW download") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH] drm/nouveau/acr: potential dereference of null pointer

2021-12-15 Thread Jiasheng Jiang
The return value of kmalloc() needs to be checked. To avoid use in memcpy() in case of the failure of alloc. Fixes: 22dcda45a3d1 ("drm/nouveau/acr: implement new subdev to replace "secure boot"") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/nouveau/nvkm/subdev/acr/hs

[PATCH v3] drm: mali-dp: potential dereference of null pointer

2021-12-14 Thread Jiasheng Jiang
The return value of kzalloc() needs to be checked. To avoid use of null pointer '&state->base' in case of the failure of alloc. Fixes: 99665d072183 ("drm: mali-dp: add malidp_crtc_state struct") Signed-off-by: Jiasheng Jiang Reviewed-by: Brian Starkey --- Changelog:

[PATCH v2] drm: mali-dp: potential dereference of null pointer

2021-12-14 Thread Jiasheng Jiang
The return value of kzalloc() needs to be checked. To avoid use of null pointer '&state->base' in case of the failure of alloc. Fixes: 99665d072183 ("drm: mali-dp: add malidp_crtc_state struct") Signed-off-by: Jiasheng Jiang Reported-by: Brian Starkey --- Changelog:

[PATCH] drm: mali-dp: potential dereference of null pointer

2021-12-14 Thread Jiasheng Jiang
The return value of kzalloc() needs to be checked. To avoid use of null pointer '&state->base' in case of the failure of alloc. Fixes: 99665d072183 ("drm: mali-dp: add malidp_crtc_state struct") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/arm/malidp_crtc.c |

[PATCH] drm/arm/mali: potential dereference of null pointer

2021-12-14 Thread Jiasheng Jiang
The return value of kzalloc() needs to be checked. To avoid use of null pointer '&mw_state->base' in case of the failure of alloc. Fixes: 8cbc5caf36ef ("drm: mali-dp: Add writeback connector") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/arm/malidp_mw.c |

[PATCH v2] drm/ast: potential dereference of null pointer

2021-12-13 Thread Jiasheng Jiang
The return value of kzalloc() needs to be checked. To avoid use of null pointer '&ast_state->base' in case of the failure of alloc. Fixes: f0adbc382b8b ("drm/ast: Allocate initial CRTC state of the correct size") Signed-off-by: Jiasheng Jiang --- Changelog: v1 -&g

[PATCH] drm/ast: potential dereference of null pointer

2021-12-13 Thread Jiasheng Jiang
The return value of kzalloc() needs to be checked. To avoid use of null pointer '&ast_state->base' in case of the failure of alloc. Fixes: f0adbc382b8b ("drm/ast: Allocate initial CRTC state of the correct size") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/ast/a

[PATCH] drm/ast: potential dereference of null pointer

2021-12-12 Thread Jiasheng Jiang
he return value of kzalloc() needs to be checked. To avoid use of null pointer '&ast_state->base' in case of the failure of alloc. Fixes: f0adbc382b8b ("drm/ast: Allocate initial CRTC state of the correct size") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/ast

[PATCH] drm/lima: Handle dma_set_coherent_mask error codes

2021-12-06 Thread Jiasheng Jiang
The return value of dma_set_coherent_mask() is not always 0. To catch the exception in case that dma is not support the mask. Fixes: a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/lima/lima_device.c | 4 +++- 1 file changed, 3

Re: Re: [PATCH] drm: mxsfb: Check NULL pointer

2021-11-04 Thread Jiasheng Jiang
On 11/3/21 8:58 AM, Marek Vasut wrote: >> As we see in the drm_connector_list_iter_next(), it could return >> NULL. In order to avoid the use of the NULL pointer, it may be >> better to check the return value. >> >> Fixes: c42001e ("drm: mxsfb: Use drm_panel_

[PATCH] drm: mxsfb: Check NULL pointer

2021-11-03 Thread Jiasheng Jiang
As we see in the drm_connector_list_iter_next(), it could return NULL. In order to avoid the use of the NULL pointer, it may be better to check the return value. Fixes: c42001e ("drm: mxsfb: Use drm_panel_bridge") Signed-off-by: Jiasheng Jiang --- drivers/gpu/drm/mxsfb/mxsfb_drv.c