crypto/nx: Use kzalloc for workmem allocation
authorHaren Myneni <haren@linux.vnet.ibm.com>
Thu, 31 Aug 2017 07:17:25 +0000 (00:17 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 1 Sep 2017 06:42:50 +0000 (16:42 +1000)
Send window is opened / closed for each crypto session.
So initializes txwin in workmem.

Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/crypto/nx/nx-842.c

index d94e25d..da3cb8c 100644 (file)
@@ -116,7 +116,7 @@ int nx842_crypto_init(struct crypto_tfm *tfm, struct nx842_driver *driver)
 
        spin_lock_init(&ctx->lock);
        ctx->driver = driver;
-       ctx->wmem = kmalloc(driver->workmem_size, GFP_KERNEL);
+       ctx->wmem = kzalloc(driver->workmem_size, GFP_KERNEL);
        ctx->sbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
        ctx->dbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
        if (!ctx->wmem || !ctx->sbounce || !ctx->dbounce) {