Skip to content

Commit 937578e

Browse files
superm1Sasha Levin
authored andcommitted
drm/amd/display: Avoid a NULL pointer dereference
commit 07b93a5 upstream. [WHY] Although unlikely drm_atomic_get_new_connector_state() or drm_atomic_get_old_connector_state() can return NULL. [HOW] Check returns before dereference. Cc: Mario Limonciello <[email protected]> Cc: Alex Deucher <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Hung <[email protected]> Tested-by: Dan Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 1e5e8d672fec9f2ab352be121be971877bff2af9) Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c19738d commit 937578e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7761,6 +7761,9 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn,
77617761
struct amdgpu_dm_connector *aconn = to_amdgpu_dm_connector(conn);
77627762
int ret;
77637763

7764+
if (WARN_ON(unlikely(!old_con_state || !new_con_state)))
7765+
return -EINVAL;
7766+
77647767
trace_amdgpu_dm_connector_atomic_check(new_con_state);
77657768

77667769
if (conn->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {

0 commit comments

Comments
 (0)