From: Arshad Hussain Date: Wed, 12 Jun 2024 09:35:17 +0000 (-0400) Subject: LU-17000 utils: Initialize 'idgot' time before using X-Git-Tag: 2.15.64~9 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=3afd41ff59d2d265d26256c4a2ec19cd26bdef44;p=fs%2Flustre-release.git 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 --- 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;