]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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:26:30 +0000 (08:26 +0200)
[ 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

index 713c325604453ded7fa57acad5c6246b9050b85f..25ebf8f19b85afa69007ce9eba8ef7b708f3b29c 100644 (file)
@@ -462,7 +462,7 @@ static int jpeg_v2_5_wait_for_idle(void *handle)
                        return ret;
        }
 
-       return ret;
+       return 0;
 }
 
 static int jpeg_v2_5_set_clockgating_state(void *handle,