crypto: ccree - use devm_k[mz]alloc() for AEAD data
As the lifetime of the AEAD data matches the lifetime of the driver, AEAD data can be allocated using the managed allocators. While at it, simplify cc_aead_free() by removing an unneeded cast, and an unneeded check (aead_handle is always valid here). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
343ee6c440
commit
ff4d719a5b
@@ -1705,11 +1705,11 @@ int cc_cipher_alloc(struct cc_drvdata *drvdata)
|
||||
t_alg->skcipher_alg.base.cra_driver_name);
|
||||
kfree(t_alg);
|
||||
goto fail0;
|
||||
} else {
|
||||
list_add_tail(&t_alg->entry, &drvdata->alg_list);
|
||||
dev_dbg(dev, "Registered %s\n",
|
||||
t_alg->skcipher_alg.base.cra_driver_name);
|
||||
}
|
||||
|
||||
list_add_tail(&t_alg->entry, &drvdata->alg_list);
|
||||
dev_dbg(dev, "Registered %s\n",
|
||||
t_alg->skcipher_alg.base.cra_driver_name);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user