mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined
[ Upstream commit375b9ff53c
] In the unlikely case that CLOCK_REALTIME is not defined, variable ret is not initialized and further accumulation of return values to ret can leave ret in an undefined state. Fix this by initialized ret to zero and changing the assignment of ret to an accumulation for the CLOCK_REALTIME case. Fixes:03f55c7952
("kselftest: Extend vDSO selftest to clock_getres") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1b2df793ae
commit
97a9a6e27b
1 changed files with 2 additions and 2 deletions
|
@ -84,12 +84,12 @@ static inline int vdso_test_clock(unsigned int clock_id)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
#if _POSIX_TIMERS > 0
|
||||
|
||||
#ifdef CLOCK_REALTIME
|
||||
ret = vdso_test_clock(CLOCK_REALTIME);
|
||||
ret += vdso_test_clock(CLOCK_REALTIME);
|
||||
#endif
|
||||
|
||||
#ifdef CLOCK_BOOTTIME
|
||||
|
|
Loading…
Add table
Reference in a new issue