]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/amdgpu: ensure the connector is not null before using it
authorTim Huang <tim.huang@amd.com>
Wed, 7 Aug 2024 09:33:42 +0000 (17:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Sep 2024 14:04:57 +0000 (10:04 -0400)
This resolves the dereference null return value warning
reported by Coverity.

Signed-off-by: Tim Huang <tim.huang@amd.com>
Reviewed-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

index 092ec11258cdd75a9293f34933e4077b4c1741fa..046d4c4e02990da707ba4ddcc692ddbdeb3cba6c 100644 (file)
@@ -1474,7 +1474,7 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
                if ((!(mode->flags & DRM_MODE_FLAG_INTERLACE)) &&
                    ((amdgpu_encoder->underscan_type == UNDERSCAN_ON) ||
                     ((amdgpu_encoder->underscan_type == UNDERSCAN_AUTO) &&
-                     connector->display_info.is_hdmi &&
+                     connector && connector->display_info.is_hdmi &&
                      amdgpu_display_is_hdtv_mode(mode)))) {
                        if (amdgpu_encoder->underscan_hborder != 0)
                                amdgpu_crtc->h_border = amdgpu_encoder->underscan_hborder;