drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer()
authorMario Limonciello <mario.limonciello@amd.com>
Wed, 8 Nov 2023 19:31:57 +0000 (13:31 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:20:17 +0000 (17:20 +0000)
commit1d07b7e84276777dad3c8cfebdf8e739606f90c9
treecb13b6a726ea71a4bd28519d51725b25f1aa9140
parent6c888a71d8d4358298305e3578b1664920af7168
drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer()

commit b71f4ade1b8900d30c661d6c27f87c35214c398c upstream.

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: 22676bc500c2 ("drm/amd/display: Fix dmub soft hang for PSR 1")
Link: https://github.com/fwupd/fwupd/issues/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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c