[AMD Official Use Only - AMD Internal Distribution Only]

This patch is
Reviewed-by: Jesse Zhang <[email protected]>

-----Original Message-----
From: Huang, Tim <[email protected]>
Sent: Friday, August 9, 2024 3:34 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian 
<[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Zhou, Bob 
<[email protected]>; Huang, Tim <[email protected]>
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 <[email protected]>
---
 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

Reply via email to