From 3afd41ff59d2d265d26256c4a2ec19cd26bdef44 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Wed, 12 Jun 2024 05:35:17 -0400 Subject: [PATCH] LU-17000 utils: Initialize 'idgot' time before using In case there is an error reading the contents of permission file. gettimeofday() is correctly not called on 'idgot'. However, this means that 'idgot' timeval is left uninitialized. This patch Initialize 'idgot' timeval to 0 so that in case as above the value is printed as zero and not garbage. Test-Parameters: trivial CoverityID: 397122 ("Uninitialized scalar variable") Fixes: d5b26443 ("LU-16615 utils: add messages in l_getidentity") Signed-off-by: Arshad Hussain Change-Id: Ie3d5dff1f02ede83690472e60cc14c12ec5d978a Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55402 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- lustre/utils/l_getidentity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/utils/l_getidentity.c b/lustre/utils/l_getidentity.c index 3c76c85..b077b14 100644 --- a/lustre/utils/l_getidentity.c +++ b/lustre/utils/l_getidentity.c @@ -934,7 +934,7 @@ int main(int argc, char **argv) struct identity_downcall_data *data = NULL; glob_t path; unsigned long uid; - struct timeval start, idgot, fini; + struct timeval start, idgot = {0}, fini; int fd, rc = -EINVAL, size, maxgroups; bool alreadyfailed = false; -- 1.8.3.1