Skip to content

Commit e559e91

Browse files
Sebastian Siewiorherbertx
authored andcommitted
[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>
1 parent e69ff73 commit e559e91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crypto/ablkcipher.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ static void crypto_ablkcipher_show(struct seq_file *m, struct crypto_alg *alg)
9191
seq_printf(m, "min keysize : %u\n", ablkcipher->min_keysize);
9292
seq_printf(m, "max keysize : %u\n", ablkcipher->max_keysize);
9393
seq_printf(m, "ivsize : %u\n", ablkcipher->ivsize);
94-
seq_printf(m, "qlen : %u\n", ablkcipher->queue->qlen);
95-
seq_printf(m, "max qlen : %u\n", ablkcipher->queue->max_qlen);
94+
if (ablkcipher->queue) {
95+
seq_printf(m, "qlen : %u\n", ablkcipher->queue->qlen);
96+
seq_printf(m, "max qlen : %u\n", ablkcipher->queue->max_qlen);
97+
}
9698
}
9799

98100
const struct crypto_type crypto_ablkcipher_type = {

0 commit comments

Comments
 (0)