]> nv-tegra.nvidia Code Review - linux-3.10.git/commitdiff
[CRYPTO] api: Allow ablkcipher with no queues
authorSebastian Siewior <linux-crypto@ml.breakpoint.cc>
Fri, 22 Jun 2007 11:47:35 +0000 (19:47 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 11 Jul 2007 12:58:55 +0000 (20:58 +0800)
Evgeniy's hifn driver and probably mine don't use ablkcipher->queue at all.
The show method of ablkcipher will access this field without checking if it
is valid.

Signed-off-by: Sebastian Siewior <linux-crypto@ml.breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ablkcipher.c

index d45fa16dff81c4c766ea4eee1ee4379bb817d053..1c166b47b4cc5b5a627c9ab5a8821d7f4f482779 100644 (file)
@@ -91,8 +91,10 @@ static void crypto_ablkcipher_show(struct seq_file *m, struct crypto_alg *alg)
        seq_printf(m, "min keysize  : %u\n", ablkcipher->min_keysize);
        seq_printf(m, "max keysize  : %u\n", ablkcipher->max_keysize);
        seq_printf(m, "ivsize       : %u\n", ablkcipher->ivsize);
-       seq_printf(m, "qlen         : %u\n", ablkcipher->queue->qlen);
-       seq_printf(m, "max qlen     : %u\n", ablkcipher->queue->max_qlen);
+       if (ablkcipher->queue) {
+               seq_printf(m, "qlen         : %u\n", ablkcipher->queue->qlen);
+               seq_printf(m, "max qlen     : %u\n", ablkcipher->queue->max_qlen);
+       }
 }
 
 const struct crypto_type crypto_ablkcipher_type = {