mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Unify checks for misaligned values.
This commit is contained in:
committed by
Milan Broz
parent
622943529e
commit
d41b1a7560
@@ -153,7 +153,7 @@ int crypt_wipe_device(struct crypt_device *cd,
|
||||
/* FIXME: if wipe_block_size < bsize, then a wipe is highly ineffective */
|
||||
|
||||
/* Everything must be aligned to SECTOR_SIZE */
|
||||
if ((offset % SECTOR_SIZE) || (length % SECTOR_SIZE) || (wipe_block_size % SECTOR_SIZE))
|
||||
if (MISALIGNED_512(offset) || MISALIGNED_512(length) || MISALIGNED_512(wipe_block_size))
|
||||
return -EINVAL;
|
||||
|
||||
devfd = device_open(device, O_RDWR);
|
||||
|
||||
Reference in New Issue
Block a user