Skip to content

Commit 270b301

Browse files
Pekkarialexdeucher
authored andcommitted
drm/amd/display: fix NULL dereference
The following patch will fix a minor issue where a debug message is referencing an struct that has just being checked whether is null or not. This has been noticed by using coccinelle, in the following output: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c:540:25-29: ERROR: aconnector is NULL but dereferenced. Fixes: 5d72e24 ("drm/amd/display: switch DC over to the new DRM logging macros") Signed-off-by: José Pekkarinen <jose.pekkarinen@foxhound.fi> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent b71f4ad commit 270b301

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,8 @@ bool dm_helpers_dp_read_dpcd(
536536

537537
struct amdgpu_dm_connector *aconnector = link->priv;
538538

539-
if (!aconnector) {
540-
drm_dbg_dp(aconnector->base.dev,
541-
"Failed to find connector for link!\n");
539+
if (!aconnector)
542540
return false;
543-
}
544541

545542
return drm_dp_dpcd_read(&aconnector->dm_dp_aux.aux, address, data,
546543
size) == size;

0 commit comments

Comments
 (0)