Skip to content

Commit

Permalink
crypto: ecdh - remove empty exit()
Browse files Browse the repository at this point in the history
Pointer members of an object with static storage duration, if not
explicitly initialized, will be initialized to a NULL pointer. The crypto
API checks if this pointer is not NULL before using it, we are safe to
remove the function.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
ambarus authored and herbertx committed Nov 6, 2017
1 parent 3c24f99 commit f560acc
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crypto/ecdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,11 @@ static unsigned int ecdh_max_size(struct crypto_kpp *tfm)
return ctx->ndigits << (ECC_DIGITS_TO_BYTES_SHIFT + 1);
}

static void no_exit_tfm(struct crypto_kpp *tfm)
{
return;
}

static struct kpp_alg ecdh = {
.set_secret = ecdh_set_secret,
.generate_public_key = ecdh_compute_value,
.compute_shared_secret = ecdh_compute_value,
.max_size = ecdh_max_size,
.exit = no_exit_tfm,
.base = {
.cra_name = "ecdh",
.cra_driver_name = "ecdh-generic",
Expand Down

0 comments on commit f560acc

Please sign in to comment.