Skip to content

Commit b71f4ad

Browse files
superm1alexdeucher
authored andcommitted
drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer()
When ddc_service_construct() is called, it explicitly checks both the link type and whether there is something on the link which will dictate whether the pin is marked as hw_supported. If the pin isn't set or the link is not set (such as from unloading/reloading amdgpu in an IGT test) then fail the amdgpu_dm_i2c_xfer() call. Cc: stable@vger.kernel.org Fixes: 22676bc ("drm/amd/display: Fix dmub soft hang for PSR 1") Link: fwupd/fwupd#6327 Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 9725a4f commit b71f4ad

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7481,6 +7481,9 @@ static int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap,
74817481
int i;
74827482
int result = -EIO;
74837483

7484+
if (!ddc_service->ddc_pin || !ddc_service->ddc_pin->hw_info.hw_supported)
7485+
return result;
7486+
74847487
cmd.payloads = kcalloc(num, sizeof(struct i2c_payload), GFP_KERNEL);
74857488

74867489
if (!cmd.payloads)

0 commit comments

Comments
 (0)