]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/display: bios_parser: fix GPIO I2C line off-by-one
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Tue, 24 Mar 2026 08:51:30 +0000 (16:51 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 30 Mar 2026 18:39:18 +0000 (14:39 -0400)
commit12fa1fd6dffff4eed15f1414eb7474127b2c5a24
tree8632a7d1bc53feb613b1b436a87cccdde17b1249
parent31b8de5e55666f26ea7ece5f412b83eab3f56dbb
drm/amd/display: bios_parser: fix GPIO I2C line off-by-one

get_gpio_i2c_info() computes the number of GPIO I2C assignment records
present in the BIOS table and then uses bfI2C_LineMux as an array index
into header->asGPIO_Info[]. The current check only rejects values
strictly larger than the record count, so an index equal to count still
falls through and reaches the fixed table one element past the end.

Reject indices at or above the number of available records before using
them as an array index.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c