Commit 36e88396 authored by Milan Broz's avatar Milan Broz

Do not fail if device is smaller than requested wipe size.

parent 61305a50
......@@ -164,6 +164,9 @@ int crypt_wipe_device(struct crypt_device *cd,
if (r || dev_size == 0)
goto out;
if (dev_size < length)
length = 0;
if (length) {
if ((dev_size <= offset) || (dev_size - offset) < length) {
r = -EINVAL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment