crypto: atmel-ecc - simplify atmel_ecdh_compute_shared_secret
Subsystems (3)
Thorsten Blum
maintainerPATCH 1/1 crypto: atmel-ecc - simplify atmel_ecdh_compute_shared_secret
Free work_data and return ret directly to simplify the control flow.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/crypto/atmel-ecc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/crypto/atmel-ecc.c +4 -6
@@ -177,16 +177,14 @@ static int atmel_ecdh_compute_shared_secret(struct kpp_request *req) work_data->client = ctx->client; ret =atmel_i2c_init_ecdh_cmd (&work_data->cmd, req->src); -if (ret) - goto free_work_data; +if (ret) { +kfree (work_data); +return ret; + }atmel_i2c_enqueue (work_data, atmel_ecdh_done, req);return -EINPROGRESS ; - -free_work_data: -kfree (work_data); -return ret; }static struct i2c_client *atmel_ecc_i2c_client_alloc (void )
Herbert Xu
maintainerQuoted 6 lines · Thorsten Blum
Free
work_dataand return ret directly to simplify the control flow.Signed-off-by Thorsten Blum <[email protected]>--- drivers/crypto/atmel-ecc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt