From ab6bc2c82093b29931588e14e411c9b320cb9093 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 15 Jun 2023 03:00:16 +0000 Subject: [PATCH] drm/amd: Fix an out of bounds error in BIOS parser From Mario Limonciello 5675ecd2e0b00a4318ba1db1a1234e7d45b13d6b in linux-6.1.y/6.1.30 d116db180decec1b21bba31d2ff495ac4d8e1b83 in mainline linux --- sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c b/sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c index 074e70a5c45..e507d2e1410 100644 --- a/sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c +++ b/sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c @@ -516,11 +516,8 @@ static enum bp_result get_gpio_i2c_info( info->i2c_slave_address = record->i2c_slave_addr; /* TODO: check how to get register offset for en, Y, etc. */ - info->gpio_info.clk_a_register_index = - le16_to_cpu( - header->gpio_pin[table_index].data_a_reg_index); - info->gpio_info.clk_a_shift = - header->gpio_pin[table_index].gpio_bitshift; + info->gpio_info.clk_a_register_index = le16_to_cpu(pin->data_a_reg_index); + info->gpio_info.clk_a_shift = pin->gpio_bitshift; return BP_RESULT_OK; } -- 2.20.1