]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/tcrypt.c
crypto: pcrypt - Do not clear MAY_SLEEP flag in original request
[mirror_ubuntu-bionic-kernel.git] / crypto / tcrypt.c
index 9267cbdb14d2458a66e36468755d9d7b0a27b7a4..11662ec1a9ecce30952681f0a441fb6a5276b3ca 100644 (file)
@@ -198,11 +198,13 @@ static void sg_init_aead(struct scatterlist *sg, char *xbuf[XBUFSIZE],
        }
 
        sg_init_table(sg, np + 1);
-       np--;
+       if (rem)
+               np--;
        for (k = 0; k < np; k++)
                sg_set_buf(&sg[k + 1], xbuf[k], PAGE_SIZE);
 
-       sg_set_buf(&sg[k + 1], xbuf[k], rem);
+       if (rem)
+               sg_set_buf(&sg[k + 1], xbuf[k], rem);
 }
 
 static void test_aead_speed(const char *algo, int enc, unsigned int secs,
@@ -696,6 +698,9 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs,
                        break;
                }
 
+               if (speed[i].klen)
+                       crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen);
+
                pr_info("test%3u "
                        "(%5u byte blocks,%5u bytes per update,%4u updates): ",
                        i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen);