浏览代码

[CRYPTO] api: Allow ablkcipher with no queues

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>
Sebastian Siewior 18 年之前
父节点
当前提交
e559e91cce
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      crypto/ablkcipher.c

+ 4 - 2
crypto/ablkcipher.c

@@ -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 = {