Skip to content

Commit aaec542

Browse files
WhiteFox-Projectgregkh
authored andcommitted
drm/msm/dpu: Add a null ptr check for dpu_encoder_needs_modeset
[ Upstream commit abebfed ] The drm_atomic_get_new_connector_state() can return NULL if the connector is not part of the atomic state. Add a check to prevent a NULL pointer dereference. This follows the same pattern used in dpu_encoder_update_topology() within the same file, which checks for NULL before using conn_state. Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com> Fixes: 1ce69c2 ("drm/msm/dpu: move resource allocation to CRTC") Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/665188/ Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4437134 commit aaec542

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ bool dpu_encoder_needs_modeset(struct drm_encoder *drm_enc, struct drm_atomic_st
729729
return false;
730730

731731
conn_state = drm_atomic_get_new_connector_state(state, connector);
732+
if (!conn_state)
733+
return false;
732734

733735
/**
734736
* These checks are duplicated from dpu_encoder_update_topology() since

0 commit comments

Comments
 (0)