mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
crypto: qat - release instance on DH fallback allocation failure
qat_dh_init_tfm() acquires a QAT crypto instance before allocating the
software fallback transform. If fallback allocation fails, the instance
reference is leaked and the device remains permanently in use.
Release the instance before returning the allocation error.
Fixes: 5d5bd24f41 ("crypto: qat - implement dh fallback for primes > 4K")
Signed-off-by: Ahsan Atta <ahsan.atta@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
57818119c9
commit
307e27d3e0
|
|
@ -535,8 +535,10 @@ static int qat_dh_init_tfm(struct crypto_kpp *tfm)
|
|||
return -EINVAL;
|
||||
|
||||
ctx->ftfm = crypto_alloc_kpp(alg, 0, CRYPTO_ALG_NEED_FALLBACK);
|
||||
if (IS_ERR(ctx->ftfm))
|
||||
if (IS_ERR(ctx->ftfm)) {
|
||||
qat_crypto_put_instance(inst);
|
||||
return PTR_ERR(ctx->ftfm);
|
||||
}
|
||||
|
||||
crypto_kpp_set_flags(ctx->ftfm, crypto_kpp_get_flags(tfm));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user