3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

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.
This commit is contained in:
James Prestwood 2022-02-18 11:55:05 -08:00 committed by Denis Kenzior
parent cd3857f810
commit 5ca7948dfb

View File

@ -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)",