diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2026-02-20 17:03:13 +0300 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2026-03-07 08:12:20 +0300 |
| commit | 095d50008d55d13f8fcf1bbeb7c6eba51779bc85 (patch) | |
| tree | 048bc40541973f3c864fe47338ab9a3b875e674b | |
| parent | de4e66b763d1e81188cb2803ec109466582fc9d1 (diff) | |
| download | linux-095d50008d55d13f8fcf1bbeb7c6eba51779bc85.tar.xz | |
crypto: atmel-ecc - Release client on allocation failure
Call atmel_ecc_i2c_client_free() to release the I2C client reserved by
atmel_ecc_i2c_client_alloc() when crypto_alloc_kpp() fails. Otherwise
->tfm_count will be out of sync.
Fixes: 11105693fa05 ("crypto: atmel-ecc - introduce Microchip / Atmel ECC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
| -rw-r--r-- | drivers/crypto/atmel-ecc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c index b6a77c8d439c..9c380351d2f9 100644 --- a/drivers/crypto/atmel-ecc.c +++ b/drivers/crypto/atmel-ecc.c @@ -261,6 +261,7 @@ static int atmel_ecdh_init_tfm(struct crypto_kpp *tfm) if (IS_ERR(fallback)) { dev_err(&ctx->client->dev, "Failed to allocate transformation for '%s': %ld\n", alg, PTR_ERR(fallback)); + atmel_ecc_i2c_client_free(ctx->client); return PTR_ERR(fallback); } |
