[PATCH 1/2] drm/amdgpu: ensure the connector is not null before using it

Zhang, Jesse(Jie) Jesse.Zhang at amd.com
Wed Aug 14 08:59:22 UTC 2024


[AMD Official Use Only - AMD Internal Distribution Only]

This patch is
Reviewed-by: Jesse Zhang <jesse.zhang at amd.com>

-----Original Message-----
From: Huang, Tim <Tim.Huang at amd.com>
Sent: Friday, August 9, 2024 3:34 PM
To: amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian <Christian.Koenig at amd.com>; Zhang, Jesse(Jie) <Jesse.Zhang at amd.com>; Zhou, Bob <Bob.Zhou at amd.com>; Huang, Tim <Tim.Huang at amd.com>
Subject: [PATCH 1/2] drm/amdgpu: ensure the connector is not null before using it

This resolves the dereference null return value warning reported by Coverity.

Signed-off-by: Tim Huang <tim.huang at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 092ec11258cd..046d4c4e0299 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -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;
--
2.43.0



More information about the amd-gfx mailing list