Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: qat - comply with crypto_kpp_maxsize()

crypto_kpp_maxsize() asks for the output buffer size without
caring for errors. It allways assume that will be called after
a valid setkey. Comply with it and return what he wants.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Tudor-Dan Ambarus and committed by
Herbert Xu
85ac98cb d0efb48b

+2 -2
+2 -2
drivers/crypto/qat/qat_common/qat_asym_algs.c
··· 521 521 return 0; 522 522 } 523 523 524 - static int qat_dh_max_size(struct crypto_kpp *tfm) 524 + static unsigned int qat_dh_max_size(struct crypto_kpp *tfm) 525 525 { 526 526 struct qat_dh_ctx *ctx = kpp_tfm_ctx(tfm); 527 527 528 - return ctx->p ? ctx->p_size : -EINVAL; 528 + return ctx->p_size; 529 529 } 530 530 531 531 static int qat_dh_init_tfm(struct crypto_kpp *tfm)