]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - crypto/skcipher.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatchin...
[linux.git] / crypto / skcipher.c
index bcf13d95f54aceccc7834aff77a68cbb3e91a0ec..2e66f312e2c4f8203985df4fad8bccf966d443dc 100644 (file)
@@ -131,8 +131,13 @@ int skcipher_walk_done(struct skcipher_walk *walk, int err)
                memcpy(walk->dst.virt.addr, walk->page, n);
                skcipher_unmap_dst(walk);
        } else if (unlikely(walk->flags & SKCIPHER_WALK_SLOW)) {
-               if (WARN_ON(err)) {
-                       /* unexpected case; didn't process all bytes */
+               if (err) {
+                       /*
+                        * Didn't process all bytes.  Either the algorithm is
+                        * broken, or this was the last step and it turned out
+                        * the message wasn't evenly divisible into blocks but
+                        * the algorithm requires it.
+                        */
                        err = -EINVAL;
                        goto finish;
                }