]> www.infradead.org Git - users/dwmw2/linux.git/commit
drm/amd/display: Check otg_master pointer before use it
authorRodrigo Siqueira <rodrigo.siqueira@amd.com>
Wed, 29 May 2024 14:57:02 +0000 (08:57 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2024 20:17:17 +0000 (16:17 -0400)
commit9d8152cd1be1c1049dc7d70e2f0a01989d1d9a17
tree24b4470b71aa58738a7d7e95ab3e26fb3c6a6e33
parent7c70e60fbf4bff1123f0e8d5cb1ae71df6164d7f
drm/amd/display: Check otg_master pointer before use it

Coverity highlighted that the parameter otg_master is referenced before
the if condition that validates it, which means that the code might have
some attempt to access a null pointer. This commit addresses this issue
by moving the pointer verification to the beginning of the function and
initializing all the values right after it.

Acked-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c