mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
drm/amd/display: Avoid a NULL pointer dereference
[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 <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1e5e8d672f)
Cc: stable@vger.kernel.org
This commit is contained in:
committed by
Alex Deucher
parent
79e25cd06e
commit
07b93a5704
@@ -7792,6 +7792,9 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn,
|
||||
struct amdgpu_dm_connector *aconn = to_amdgpu_dm_connector(conn);
|
||||
int ret;
|
||||
|
||||
if (WARN_ON(unlikely(!old_con_state || !new_con_state)))
|
||||
return -EINVAL;
|
||||
|
||||
trace_amdgpu_dm_connector_atomic_check(new_con_state);
|
||||
|
||||
if (conn->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
|
||||
|
||||
Reference in New Issue
Block a user