From 5ca7948dfbd7cfcc84437b86dc6a5d8d08537eb3 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 18 Feb 2022 11:55:05 -0800 Subject: [PATCH] main: remove unneeded stat call Static analysis flagged that 'path' was never being checked (which should not ever be NULL) but during that review I noticed stat() was being called, then fstat afterwards. --- src/main.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main.c b/src/main.c index 7a378b64..a3d85535 100644 --- a/src/main.c +++ b/src/main.c @@ -429,11 +429,6 @@ static bool setup_system_key(void) path = l_strdup_printf("%s/%s", cred_dir, key_id); - if (stat(path, &st) < 0) { - l_warn("SystemdEncrypt: Could not stat %s", path); - return false; - } - fd = open(path, O_RDONLY, 0); if (fd < 0) { l_warn("SystemdEncrypt: Cannot open secret: %s (%d)",