]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: invalid parameter check in dmub_hpd_callback
authorJosé Expósito <jose.exposito89@gmail.com>
Sun, 9 Jan 2022 18:42:45 +0000 (19:42 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Jan 2022 20:44:27 +0000 (15:44 -0500)
commit40b318d067f55ae66e0871a4f744f3c57f244cdc
tree951ec7a7cf2a42126531bf6ae09891998d69803e
parente15de49602516b8c2ca6a5cf70d12ffa206f1382
drm/amd/display: invalid parameter check in dmub_hpd_callback

The function performs a check on the "adev" input parameter, however, it
is used before the check.

Initialize the "dev" variable after the sanity check to avoid a possible
NULL pointer dereference.

Fixes: 5c4f2ed1ef609 ("drm/amd/display: Support for DMUB HPD interrupt handling")
Addresses-Coverity-ID: 1493909 ("Null pointer dereference")
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c