mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
code cleanup related to devfd checks
alter all checks for devfd value after device_open to less than zero insted of equals to -1. device_open will return values different from -1 in case error happens. In LUKSv1 device_open should always return -1 in case of error but this check is safer. The rest is just formating improvement.
This commit is contained in:
committed by
Milan Broz
parent
f397d42d73
commit
16fab74ab1
@@ -166,7 +166,7 @@ int crypt_wipe(struct device *device,
|
||||
|
||||
/* coverity[toctou] */
|
||||
devfd = device_open(device, flags);
|
||||
if (devfd == -1) {
|
||||
if (devfd < 0) {
|
||||
free(buffer);
|
||||
return errno ? -errno : -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user