[PATCH v2] drm/amd/display: Fix null check for pipe_ctx->plane_state in resource_build_scaling_params

2025-02-26 Thread Ma Ke
"drm/amd/display: Rename more dc_surface stuff to plane_state") Signed-off-by: Ma Ke --- Changes in v2: - modified the patch as suggestions. --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/displa

[PATCH] drm/amd/display: Fix null check for pipe_ctx->plane_state in resource_build_scaling_params

2025-02-24 Thread Ma Ke
"drm/amd/display: Rename more dc_surface stuff to plane_state") Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_res

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

2024-09-14 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

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

2024-09-09 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/amd/display: Add null check before access structs in dcn32_enable_phantom_plane

2024-09-01 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

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-21 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/amd/display: avoid using null object of framebuffer

2024-08-15 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 v3] drm/amdgpu: fix a possible null pointer dereference

2024-07-19 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/amd/amdgpu: Fix uninitialized variable warnings

2024-07-19 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 v2] drm/radeon: fix null pointer dereference in radeon_add_common_modes

2024-07-19 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] drm/amd/amdgpu: Fix uninitialized variable warnings

2024-07-12 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-11 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 v2] drm/amd/display: Add otg_master NULL check within init_pipe_slice_table_from_context

2024-07-10 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 RESEND] drm/radeon: fix null pointer dereference in radeon_add_common_modes

2024-07-05 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/amd/display: Add otg_master NULL check within init_pipe_slice_table_from_context

2024-07-05 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 RESEND] drm/amd/display: Check pipe_ctx before it is used

2024-07-05 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] 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/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/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/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/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/amdgpu/vkms: fix a possible null pointer dereference

2023-10-13 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/radeon: fix a possible null pointer dereference

2023-10-13 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/radeon: fix a possible null pointer dereference

2023-10-11 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