mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 19:02:34 +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:
parent
cd3857f810
commit
5ca7948dfb
@ -429,11 +429,6 @@ static bool setup_system_key(void)
|
|||||||
|
|
||||||
path = l_strdup_printf("%s/%s", cred_dir, key_id);
|
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);
|
fd = open(path, O_RDONLY, 0);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
l_warn("SystemdEncrypt: Cannot open secret: %s (%d)",
|
l_warn("SystemdEncrypt: Cannot open secret: %s (%d)",
|
||||||
|
Loading…
Reference in New Issue
Block a user