mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
drm/amd/display: Fix null check for pipe_ctx->plane_state in resource_build_scaling_params
Null pointer dereference issue could occur when pipe_ctx->plane_state is null. The fix adds a check to ensure 'pipe_ctx->plane_state' is not null before accessing. This prevents a null pointer dereference. Found by code review. Fixes:3be5262e35("drm/amd/display: Rename more dc_surface stuff to plane_state") Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Ma Ke <make24@iscas.ac.cn> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit63e6a77ccf) Cc: stable@vger.kernel.org
This commit is contained in:
parent
7eb172143d
commit
374c9faac5
|
|
@ -1455,7 +1455,8 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
|
|||
DC_LOGGER_INIT(pipe_ctx->stream->ctx->logger);
|
||||
|
||||
/* Invalid input */
|
||||
if (!plane_state->dst_rect.width ||
|
||||
if (!plane_state ||
|
||||
!plane_state->dst_rect.width ||
|
||||
!plane_state->dst_rect.height ||
|
||||
!plane_state->src_rect.width ||
|
||||
!plane_state->src_rect.height) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user