[PATCH] drm/amd/display: Skip dpp1_dscl_set_scaler_filter if filter is null

2024-09-13 Thread Ma Ke
Callers can pass null in filter (i.e. from returned from the function dpp1_dscl_get_filter_coeffs_64p) and a null check is added to ensure that is not the case. Cc: sta...@vger.kernel.org Fixes: 5e9a81b2c465 ("drm/amd/display: separate scl functions out from dcn10_dpp") Signed-off

Re: [PATCH RESEND] drm/sti: avoid potential dereference of error pointers

2024-09-13 Thread Ma Ke
M +0200, Alain Volmat wrote: > > Hi, > > > > Thanks for your patch. > > > > Acked-by: Alain Volmat > > > > Regards, > > Alain > > > > On Mon, Aug 26, 2024 at 01:26:52PM +0800, Ma Ke wrote: > > > The return value of drm_atomic_ge

[PATCH] drm/sti: avoid potential dereference of error pointers in sti_hqvdp_atomic_check

2024-09-13 Thread Ma Ke
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Cc: sta...@vger.kernel.org Fixes: dd86dc2f9ae1 ("drm/sti: implement atomic_check for the planes") Signed-off-by: Ma Ke --- drivers/gpu/drm

[PATCH v2] drm/sti: avoid potential dereference of error pointers

2024-09-13 Thread Ma Ke
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Cc: sta...@vger.kernel.org Fixes: dd86dc2f9ae1 ("drm/sti: implement atomic_check for the planes") Signed-off-by: Ma Ke --- Changes in v2:

[PATCH RESEND] drm/nouveau: fix a possible null pointer dereference

2024-09-08 Thread Ma Ke
d DRM driver for NVIDIA GPUs") Signed-off-by: Ma Ke --- drivers/gpu/drm/i2c/ch7006_drv.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c index 131512a5f3bd..48bf6e4e8bdb 100644 --- a/drivers/g

[PATCH RESEND] drm/amd/display: Add null check before access structs in dcn32_enable_phantom_plane

2024-09-08 Thread Ma Ke
In dcn32_enable_phantom_plane, we should better check null pointer before accessing various structs. Cc: sta...@vger.kernel.org Fixes: 235c67634230 ("drm/amd/display: add DCN32/321 specific files for Display Core") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/reso

[PATCH RESEND] drm/sti: avoid potential dereference of error pointers in sti_gdp_atomic_check

2024-09-08 Thread Ma Ke
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Cc: sta...@vger.kernel.org Fixes: dd86dc2f9ae1 ("drm/sti: implement atomic_check for the planes") Signed-off-by: Ma Ke --- drivers/gpu/d

[PATCH RESEND] drm/nouveau: fix a possible null pointer dereference

2024-09-02 Thread Ma Ke
d DRM driver for NVIDIA GPUs") Signed-off-by: Ma Ke --- drivers/gpu/drm/i2c/ch7006_drv.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c index 131512a5f3bd..48bf6e4e8bdb 100644 --- a/drivers/g

[PATCH] drm/amd/display: Add null check before access structs in dcn32_enable_phantom_plane

2024-08-30 Thread Ma Ke
In dcn32_enable_phantom_plane, we should better check null pointer before accessing various structs. Cc: sta...@vger.kernel.org Fixes: 235c67634230 ("drm/amd/display: add DCN32/321 specific files for Display Core") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/reso

[PATCH] drm/sti: avoid potential dereference of error pointers in sti_gdp_atomic_check

2024-08-30 Thread Ma Ke
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Cc: sta...@vger.kernel.org Fixes: dd86dc2f9ae1 ("drm/sti: implement atomic_check for the planes") Signed-off-by: Ma Ke --- drivers/gpu/d

[PATCH RESEND] drm/sti: avoid potential dereference of error pointers

2024-08-25 Thread Ma Ke
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Cc: sta...@vger.kernel.org Fixes: dec92020671c ("drm: Use the state pointer directly in planes atomic_check") Signed-off-by: Ma Ke ---

[PATCH RESEND] drm/nouveau: fix a possible null pointer dereference

2024-08-24 Thread Ma Ke
d DRM driver for NVIDIA GPUs") Signed-off-by: Ma Ke --- drivers/gpu/drm/i2c/ch7006_drv.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c index 131512a5f3bd..48bf6e4e8bdb 100644 --- a/drivers/g

Re: [PATCH RESEND] drm/amd/display: avoid using null object of framebuffer

2024-08-22 Thread Ma Ke
Alex Deucher wrote: > On Wed, Aug 21, 2024 at 3:45 AM Ma Ke wrote: > > > > Instead of using state->fb->obj[0] directly, get object from framebuffer > > by calling drm_gem_fb_get_obj() and return error code when object is > > null to avoid using null objec

[PATCH RESEND] drm/amd/display: avoid using null object of framebuffer

2024-08-20 Thread Ma Ke
d to planes") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c in

[PATCH] drm/sti: avoid potential dereference of error pointers

2024-08-19 Thread Ma Ke
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Cc: sta...@vger.kernel.org Fixes: dec92020671c ("drm: Use the state pointer directly in planes atomic_check") Signed-off-by: Ma Ke ---

[PATCH RESEND] drm/nouveau: fix a possible null pointer dereference

2024-08-18 Thread Ma Ke
d DRM driver for NVIDIA GPUs") Signed-off-by: Ma Ke --- drivers/gpu/drm/i2c/ch7006_drv.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c index 131512a5f3bd..cd68c32a4ba2 100644 --- a/drivers/g

[PATCH] drm/amd/display: avoid using null object of framebuffer

2024-08-14 Thread Ma Ke
d to planes") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c in

[PATCH RESEND] drm/nouveau: fix a possible null pointer dereference

2024-08-10 Thread Ma Ke
d DRM driver for NVIDIA GPUs") Signed-off-by: Ma Ke --- drivers/gpu/drm/i2c/ch7006_drv.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c index 131512a5f3bd..48bf6e4e8bdb 100644 --- a/drivers/g

[PATCH] drm: omapdrm: Add missing check for alloc_ordered_workqueue

2024-08-07 Thread Ma Ke
As it may return NULL pointer and cause NULL pointer dereference. Add check for the return value of alloc_ordered_workqueue. Cc: sta...@vger.kernel.org Fixes: 2f95bc6d324a ("drm: omapdrm: Perform initialization/cleanup at probe/remove time") Signed-off-by: Ma Ke --- drivers/gpu/d

[PATCH] drm/i915: Fix NULL ptr deref in intel_async_flip_check_uapi()

2024-08-06 Thread Ma Ke
kernel.org Fixes: b0b2bed2a130 ("drm/i915: Check async flip capability early on") Signed-off-by: Ma Ke --- drivers/gpu/drm/i915/display/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/dis

[PATCH v4 RESEND] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-08-01 Thread Ma Ke
Move out modeset config code") Signed-off-by: Ma Ke --- Changes in v4: - modified patch, set ret and break to handle error rightly. Changes in v3: - modified patch as suggestions, returned error directly when failing to get modeset->mode. Changes in v2: - added the recipient's emai

[PATCH RESEND] drm/nouveau: fix a possible null pointer dereference

2024-08-01 Thread Ma Ke
d DRM driver for NVIDIA GPUs") Signed-off-by: Ma Ke --- drivers/gpu/drm/i2c/ch7006_drv.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c index 131512a5f3bd..48bf6e4e8bdb 100644 --- a/drivers/g

[PATCH v4] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-07-24 Thread Ma Ke
Move out modeset config code") Signed-off-by: Ma Ke --- Changes in v4: - modified patch, set ret and break to handle error rightly. Changes in v3: - modified patch as suggestions, returned error directly when failing to get modeset->mode. Changes in v2: - added the recipient's emai

Re: [PATCH v3] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-07-24 Thread Ma Ke
On Wed, 24 Jul 2024, Jani Nikula wrote: > On Wed, 24 Jul 2024, Ma Ke wrote: > > On Wed, 24 Jul 2024, Jani Nikula wrote: > >> On Wed, 24 Jul 2024, Ma Ke wrote: > >> > In drm_client_modeset_probe(), the return value of drm_mode_duplicate() > >> > is &g

[PATCH] drm/nouveau: fix a possible null pointer dereference

2024-07-24 Thread Ma Ke
d DRM driver for NVIDIA GPUs") Signed-off-by: Ma Ke --- drivers/gpu/drm/i2c/ch7006_drv.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c index 131512a5f3bd..48bf6e4e8bdb 100644 --- a/drivers/g

Re: [PATCH v3] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-07-24 Thread Ma Ke
On Wed, 24 Jul 2024, Jani Nikula wrote: > On Wed, 24 Jul 2024, Ma Ke wrote: > > In drm_client_modeset_probe(), the return value of drm_mode_duplicate() is > > assigned to modeset->mode, which will lead to a possible NULL pointer > > dereference on failure of drm_mode_dup

[PATCH v3] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-07-24 Thread Ma Ke
Move out modeset config code") Signed-off-by: Ma Ke --- Changes in v3: - modified patch as suggestions, returned error directly when failing to get modeset->mode. Changes in v2: - added the recipient's email address, due to the prolonged absence of a response from the recipien

[PATCH v2 RESEND] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-07-23 Thread Ma Ke
Move out modeset config code") Signed-off-by: Ma Ke --- Changes in v2: - added the recipient's email address, due to the prolonged absence of a response from the recipients. - added Cc stable. --- drivers/gpu/drm/drm_client_modeset.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH v2] drm/amd/amdgpu: Fix uninitialized variable warnings

2024-07-18 Thread Ma Ke
Return 0 to avoid returning an uninitialized variable r. Cc: sta...@vger.kernel.org Fixes: 230dd6bb6117 ("drm/amd/amdgpu: implement mode2 reset on smu_v13_0_10") Signed-off-by: Ma Ke --- Changes in v2: - added Cc stable line. --- drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 2 +- 1 fi

[PATCH v3] drm/amdgpu: fix a possible null pointer dereference

2024-07-18 Thread Ma Ke
ned-off-by: Ma Ke --- Changes in v3: - added Cc stable line. Changes in v2: - modified the patch according to suggestions; - added Fixes line. --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/d

[PATCH v2] drm/qxl: fix null pointer dereference in qxl_add_mode

2024-07-18 Thread Ma Ke
In qxl_add_mode(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a possible NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid npd. Cc: sta...@vger.kernel.org Fixes: 1b043677d4be ("drm/qxl: add qxl_add_mode helper function") Signed-

[PATCH v2] drm/radeon: fix null pointer dereference in radeon_add_common_modes

2024-07-18 Thread Ma Ke
using fb.") Signed-off-by: Ma Ke --- Changes in v2: - added a blank line; - added Cc line. --- drivers/gpu/drm/radeon/radeon_connectors.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index b8

[PATCH v2 RESEND] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-07-18 Thread Ma Ke
Move out modeset config code") Signed-off-by: Ma Ke --- Changes in v2: - added the recipient's email address, due to the prolonged absence of a response from the recipients. - added Cc stable. --- drivers/gpu/drm/drm_client_modeset.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH] drm/amd/amdgpu: Fix uninitialized variable warnings

2024-07-11 Thread Ma Ke
Return 0 to avoid returning an uninitialized variable r. Fixes: 230dd6bb6117 ("drm/amd/amdgpu: implement mode2 reset on smu_v13_0_10") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/g

[PATCH v2] drm/amdgpu: fix a possible null pointer dereference

2024-07-10 Thread Ma Ke
In amdgpu_connector_add_common_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid npd. Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Signed-off-by: Ma Ke --- Cha

[PATCH v4] drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes

2024-07-09 Thread Ma Ke
Signed-off-by: Ma Ke --- Changes in v4: - revised the recipient email list, apologize for the inadvertent mistake. Changes in v3: - added the recipient's email address, due to the prolonged absence of a response from the recipients. Changes in v2: - modified the patch according to suggest

[PATCH v2] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-07-09 Thread Ma Ke
Move out modeset config code") Signed-off-by: Ma Ke --- Changes in v2: - added the recipient's email address, due to the prolonged absence of a response from the recipients. - added Cc stable. --- drivers/gpu/drm/drm_client_modeset.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH v3] drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes

2024-07-09 Thread Ma Ke
t;) Signed-off-by: Ma Ke --- Changes in v3: - added the recipient's email address, due to the prolonged absence of a response from the recipients. Changes in v2: - modified the patch according to suggestions; - added Fixes line; - added Cc stable. --- drivers/gpu/drm/gma500/psb_intel_lvds.c

[PATCH v2] drm/amd/display: Add otg_master NULL check within init_pipe_slice_table_from_context

2024-07-09 Thread Ma Ke
To avoid reports of NULL_RETURN warning, we should add otg_master NULL check. Cc: sta...@vger.kernel.org Fixes: c51d87202d1f ("drm/amd/display: do not attempt ODM power optimization if minimal transition doesn't exist") Signed-off-by: Ma Ke --- Changes in v2: - added the re

[PATCH v3] drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes

2024-07-09 Thread Ma Ke
Signed-off-by: Ma Ke --- Changes in v3: - added the recipient's email address, due to the prolonged absence of a response from the recipients. Changes in v2: - modified the patch according to suggestions from other patchs; - added Fixes line; - added Cc stable; - Link: https://lore.

[PATCH RESEND] drm/qxl: fix null pointer dereference in qxl_add_mode

2024-07-04 Thread Ma Ke
In qxl_add_mode(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a possible NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid npd. Fixes: 1b043677d4be ("drm/qxl: add qxl_add_mode helper function") Signed-off-by: Ma Ke --- drive

[PATCH RESEND] drm/radeon: fix null pointer dereference in radeon_add_common_modes

2024-07-04 Thread Ma Ke
In radeon_add_common_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a possible NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid npd. Fixes: d50ba256b5f1 ("drm/kms: start adding command line interface using fb.") Signed-off

[PATCH RESEND] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-07-04 Thread Ma Ke
;) Signed-off-by: Ma Ke --- drivers/gpu/drm/drm_client_modeset.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index 31af5cf37a09..bbe21522dc6a 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/dr

[PATCH v2 RESEND] drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes

2024-07-04 Thread Ma Ke
t;) Signed-off-by: Ma Ke --- Changes in v2: - modified the patch according to suggestions; - added Fixes line; - added Cc stable. --- drivers/gpu/drm/gma500/psb_intel_lvds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/

[PATCH RESEND] drm/amd/display: Check pipe_ctx before it is used

2024-07-04 Thread Ma Ke
resource_get_otg_master_for_stream() could return NULL, we should check the return value of 'otg_master' before it is used in resource_log_pipe_for_stream(). Fixes: 5db346c256bb ("drm/amd/display: update pipe topology log to support subvp") Signed-off-by: Ma Ke --- drivers

[PATCH RESEND] drm/amd/display: Add otg_master NULL check within init_pipe_slice_table_from_context

2024-07-04 Thread Ma Ke
To avoid reports of NULL_RETURN warning, we should add otg_master NULL check. Fixes: c51d87202d1f ("drm/amd/display: do not attempt ODM power optimization if minimal transition doesn't exist") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 ++

[PATCH v2 RESEND] drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes

2024-07-04 Thread Ma Ke
Signed-off-by: Ma Ke --- Changes in v2: - modified the patch according to suggestions from other patchs; - added Fixes line; - added Cc stable; - Link: https://lore.kernel.org/lkml/20240622072514.1867582-1-mak...@iscas.ac.cn/T/ --- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 3 +++ 1 file

[PATCH v3] drm/nouveau: fix null pointer dereference in nouveau_connector_get_modes

2024-06-27 Thread Ma Ke
r for NVIDIA GPUs") Signed-off-by: Ma Ke --- Changes in v3: - added CC stable as suggested, sorry for my negligence. Changes in v2: - modified the patch according to suggestions; - added Fixes line. --- drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +++ 1 file changed, 3 insertions(+) di

[PATCH v2] drm/gma500: fix null pointer dereference in cdv_intel_lvds_get_modes

2024-06-26 Thread Ma Ke
Signed-off-by: Ma Ke --- Changes in v2: - modified the patch according to suggestions from other patchs; - added Fixes line; - added Cc stable; - Link: https://lore.kernel.org/lkml/20240622072514.1867582-1-mak...@iscas.ac.cn/T/ --- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 3 +++ 1 file

[PATCH v2] drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes

2024-06-26 Thread Ma Ke
t;) Signed-off-by: Ma Ke --- Changes in v2: - modified the patch according to suggestions; - added Fixes line; - added Cc stable. --- drivers/gpu/drm/gma500/psb_intel_lvds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/

[PATCH v2] drm/nouveau: fix null pointer dereference in nouveau_connector_get_modes

2024-06-26 Thread Ma Ke
ned-off-by: Ma Ke --- Changes in v2: - modified the patch according to suggestions. --- drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 856b3ef5edb8..0c

[PATCH] drm/amd/display: Add null check before access structs

2024-06-26 Thread Ma Ke
In enable_phantom_plane, we should better check null pointer before accessing various structs. Fixes: 09a4ec5da92c ("drm/amd/display: Refactor dc_state interface") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c | 2 ++ 1 file changed, 2 insertion

[PATCH] drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_hd_modes

2024-06-26 Thread Ma Ke
-off-by: Ma Ke --- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c index 670c9739e5e1..9c3dc9a5bb46 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +++ b

[PATCH] drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes

2024-06-26 Thread Ma Ke
In psb_intel_lvds_get_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a possible NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/gma500/psb_intel_lvds.c | 2 ++ 1 file

[PATCH] drm/nouveau: fix null pointer dereference in nouveau_connector_get_modes

2024-06-26 Thread Ma Ke
In nouveau_connector_get_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a possible NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 ++ 1

[PATCH] drm/nouveau/dispnv04: fix null pointer dereference in nv17_tv_get_ld_modes

2024-06-26 Thread Ma Ke
In nv17_tv_get_ld_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a possible NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Cc: sta...@vger.kernel.org Signed-off-by: Ma Ke --- drivers/gpu/drm/nouveau/dispnv04

[PATCH] drm/client: fix null pointer dereference in drm_client_modeset_probe

2024-06-26 Thread Ma Ke
In drm_client_modeset_probe(), the return value of drm_mode_duplicate() is assigned to modeset->mode, which will lead to a possible NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/drm_client_modeset.c | 2 ++ 1 f

[PATCH] drm/radeon: fix null pointer dereference in radeon_add_common_modes

2024-06-26 Thread Ma Ke
In radeon_add_common_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a possible NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/radeon/radeon_connectors.c | 2 ++ 1 file changed, 2

[PATCH] drm/qxl: fix null pointer dereference in qxl_add_mode

2024-06-25 Thread Ma Ke
In qxl_add_mode(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a possible NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH] drm/amd/display: Check pipe_ctx before it is used

2024-06-24 Thread Ma Ke
resource_get_otg_master_for_stream() could return NULL, we should check the return value of 'otg_master' before it is used in resource_log_pipe_for_stream(). Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH] drm/amd/display: Add otg_master NULL check within init_pipe_slice_table_from_context

2024-06-24 Thread Ma Ke
To avoid reports of NULL_RETURN warning, we should add otg_master NULL check. Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display

[PATCH] drm/gma500: fix a possible null pointer dereference

2024-06-22 Thread Ma Ke
In cdv_intel_lvds_get_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 2 ++ 1 file changed, 2

[PATCH] drm/amdgpu: fix a possible null pointer dereference

2024-06-22 Thread Ma Ke
In amdgpu_connector_add_common_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 2 ++ 1 file changed, 2

[PATCH] drm/radeon: fix a possible null pointer dereference

2023-10-12 Thread Ma Ke
In radeon_add_common_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid null pointer dereference. Signed-off-by: Ma Ke --- drivers/gpu/drm/radeon/radeon_connectors.c | 2 ++ 1 file

[PATCH] drm/qxl: fix a possible null pointer dereference

2023-10-12 Thread Ma Ke
In qxl_add_mode(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid null pointer dereference. Signed-off-by: Ma Ke --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions

[PATCH] drm/amdgpu/vkms: fix a possible null pointer dereference

2023-10-12 Thread Ma Ke
In amdgpu_vkms_conn_get_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid null pointer dereference. Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 ++ 1 file

[PATCH] drm/nouveau/dispnv04: fix a possible null pointer dereference

2023-10-12 Thread Ma Ke
In nv17_tv_get_hd_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). The same applies to drm_cvt_mode(). Add a check to avoid null pointer dereference. Signed-off-by: Ma Ke --- drivers/gpu/drm

[PATCH] drm/edid: fix a possible null pointer dereference

2023-10-10 Thread Ma Ke
In drm_mode_std(), the return value of drm_gtf_mode(), drm_gtf_mode() and drm_cvt_mode() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_gtf_mode(), drm_gtf_mode() and drm_cvt_mode(). Add a check to avoid null point dereference. Signed-off-by: Ma Ke

[PATCH] drm/radeon: fix a possible null pointer dereference

2023-10-10 Thread Ma Ke
In radeon_tv_get_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid null point dereference. Signed-off-by: Ma Ke --- drivers/gpu/drm/radeon/radeon_connectors.c | 2 ++ 1 file changed

[PATCH v2] drm/i2c/ch7006: fix a possible null pointer dereference

2023-10-09 Thread Ma Ke
In ch7006_encoder_get_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/i2c/ch7006_drv.c | 7 +-- 1 file changed, 5

[PATCH v2] drm/panel/panel-tpo-tpg110: fix a possible null pointer dereference

2023-10-09 Thread Ma Ke
In tpg110_get_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/panel/panel-tpo-tpg110.c | 2 ++ 1 file changed, 2 insertions

[PATCH] drm/i2c/ch7006: fix a possible null pointer dereference

2023-10-06 Thread Ma Ke
In ch7006_encoder_get_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/i2c/ch7006_drv.c | 6 -- 1 file changed, 4

[PATCH] drm/nouveau/dispnv04: fix a possible null pointer dereference

2023-10-06 Thread Ma Ke
In nv17_tv_get_ld_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 2 ++ 1 file changed, 2

[PATCH] drm/panel/panel-tpo-tpg110: fix a possible null pointer dereference

2023-10-06 Thread Ma Ke
In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/panel/panel-tpo-tpg110.c | 2 ++ 1 file changed, 2

[PATCH] drm/panel: fix a possible null pointer dereference

2023-10-06 Thread Ma Ke
In versatile_panel_get_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke --- drivers/gpu/drm/panel/panel-arm-versatile.c | 2 ++ 1 file changed

[PATCH] drm/sti: avoid potential dereference of error pointers

2023-09-22 Thread Ma Ke
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Signed-off-by: Ma Ke --- drivers/gpu/drm/sti/sti_cursor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/d

[PATCH] drm/gem: avoid potential dereference of error pointers

2023-09-22 Thread Ma Ke
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Signed-off-by: Ma Ke --- drivers/gpu/drm/sti/sti_gdp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drive

[PATCH] drm/sti: avoid potential dereference of error pointers

2023-09-20 Thread Ma Ke
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Signed-off-by: Ma Ke --- drivers/gpu/drm/sti/sti_cursor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/d