]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - crypto/seqiv.c
Merge tag 'pci-v5.1-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
[linux.git] / crypto / seqiv.c
index 64a412be255e10fb6741e144a291313c7b4b308c..ed1b0e9f2436713392f45d3c1bedf2aabab7379c 100644 (file)
@@ -89,13 +89,12 @@ static int seqiv_aead_encrypt(struct aead_request *req)
 
        if (unlikely(!IS_ALIGNED((unsigned long)info,
                                 crypto_aead_alignmask(geniv) + 1))) {
-               info = kmalloc(ivsize, req->base.flags &
-                                      CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL:
-                                                                 GFP_ATOMIC);
+               info = kmemdup(req->iv, ivsize, req->base.flags &
+                              CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL :
+                              GFP_ATOMIC);
                if (!info)
                        return -ENOMEM;
 
-               memcpy(info, req->iv, ivsize);
                compl = seqiv_aead_encrypt_complete;
                data = req;
        }