AFS: Fix possible null pointer dereference in afs_alloc_server()
[safe/jmp/linux-2.6] / crypto / shash.c
index 98b7f46..22fd943 100644 (file)
@@ -37,7 +37,7 @@ static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key,
        u8 *buffer, *alignbuffer;
        int err;
 
-       absize = keylen + (alignmask & ~(CRYPTO_MINALIGN - 1));
+       absize = keylen + (alignmask & ~(crypto_tfm_ctx_alignment() - 1));
        buffer = kmalloc(absize, GFP_KERNEL);
        if (!buffer)
                return -ENOMEM;
@@ -350,7 +350,7 @@ int crypto_init_shash_ops_async(struct crypto_tfm *tfm)
                crt->setkey = shash_async_setkey;
        if (alg->export)
                crt->export = shash_async_export;
-       if (alg->setkey)
+       if (alg->import)
                crt->import = shash_async_import;
 
        crt->reqsize = sizeof(struct shash_desc) + crypto_shash_descsize(shash);