drm/amdgpu: ensure 0 is returned for success in jpeg_v2_5_wait_for_idle
authorColin Ian King <colin.king@canonical.com>
Wed, 24 Jun 2020 14:54:18 +0000 (15:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:49 +0000 (08:23 +0200)
commit251f7e2972a154e63d37b9423477309f68d4af9f
tree97ef9c5795abf8e3dcdf47b110e3cafb8b469e36
parentf84547c2a6a3d00f48a56e439b6d14e8932f3e98
drm/amdgpu: ensure 0 is returned for success in jpeg_v2_5_wait_for_idle

[ Upstream commit 57f01856645afe4c3d0f9915ee2bb043e8dd7982 ]

In the cases where adev->jpeg.num_jpeg_inst is zero or the condition
adev->jpeg.harvest_config & (1 << i) is always non-zero the variable
ret is never set to an error condition and the function returns
an uninitialized value in ret.  Since the only exit condition at
the end if the function is a success then explicitly return
0 rather than a potentially uninitialized value in ret.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 14f43e8f88c5 ("drm/amdgpu: move JPEG2.5 out from VCN2.5")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c