]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/amd/display: Check null pointer before dereferencing se
authorAlex Hung <alex.hung@amd.com>
Thu, 29 Aug 2024 23:30:26 +0000 (17:30 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Sep 2024 20:15:08 +0000 (16:15 -0400)
[WHAT & HOW]
se is null checked previously in the same function, indicating
it might be null; therefore, it must be checked when used again.

This fixes 1 FORWARD_NULL issue reported by Coverity.

Acked-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c

index eb7c7681bdd9e948ea1af21073f0c7855a53fc64..67812fbbb006aae9663b02f71268b8a0eae37694 100644 (file)
@@ -1767,7 +1767,7 @@ bool dc_validate_boot_timing(const struct dc *dc,
                if (crtc_timing->pix_clk_100hz != pix_clk_100hz)
                        return false;
 
-               if (!se->funcs->dp_get_pixel_format)
+               if (!se || !se->funcs->dp_get_pixel_format)
                        return false;
 
                if (!se->funcs->dp_get_pixel_format(