]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/lrw.c
UBUNTU: Ubuntu-4.15.0-96.97
[mirror_ubuntu-bionic-kernel.git] / crypto / lrw.c
index cbbd7c50ad19b306cf0e424ad24533beade38764..9c5bf4afe36f1c066484e520f3675fa80e14b5e1 100644 (file)
@@ -139,7 +139,12 @@ static inline int get_index128(be128 *block)
                return x + ffz(val);
        }
 
-       return x;
+       /*
+        * If we get here, then x == 128 and we are incrementing the counter
+        * from all ones to all zeros. This means we must return index 127, i.e.
+        * the one corresponding to key2*{ 1,...,1 }.
+        */
+       return 127;
 }
 
 static int post_crypt(struct skcipher_request *req)
@@ -313,7 +318,7 @@ static void exit_crypt(struct skcipher_request *req)
        rctx->left = 0;
 
        if (rctx->ext)
-               kfree(rctx->ext);
+               kzfree(rctx->ext);
 }
 
 static int do_encrypt(struct skcipher_request *req, int err)