drm/amd/display: fix incorrect check for atom table size
authorTony Cheng <tony.cheng@amd.com>
Sun, 17 Jun 2018 17:26:27 +0000 (13:26 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Jul 2018 19:47:39 +0000 (14:47 -0500)
in case we have very few pins in the table, check fails and we can't boot

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c

index aeb56e4..eab007e 100644 (file)
@@ -678,7 +678,7 @@ static enum bp_result bios_parser_get_gpio_pin_info(
                return BP_RESULT_BADBIOSTABLE;
 
        if (sizeof(struct atom_common_table_header) +
-                       sizeof(struct atom_gpio_pin_lut_v2_1)
+                       sizeof(struct atom_gpio_pin_assignment)
                        > le16_to_cpu(header->table_header.structuresize))
                return BP_RESULT_BADBIOSTABLE;