diff options
author | Gilad Ben-Yossef <gilad@benyossef.com> | 2017-09-07 12:00:12 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-09-17 17:35:25 +0300 |
commit | 093d56156593bba5889756916b9eaf75bb35cca6 (patch) | |
tree | 23c98780316b13d1c60eadf45998ae3f5f48d60f /drivers/staging/ccree/ssi_aead.c | |
parent | 7f6f832d258a1b411dcc3ba9345ed3036fe05ca5 (diff) | |
download | linux-093d56156593bba5889756916b9eaf75bb35cca6.tar.xz |
staging: ccree: simplify resource release on error
The resource release on probe/init error was being handled
in an awkward manner and possibly leaking memory on certain
(unlikely) error path.
Fix it by simplifying the error resource release and making
it easier to track.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ccree/ssi_aead.c')
-rw-r--r-- | drivers/staging/ccree/ssi_aead.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c index 5abe6b24ff8c..8191ec43f72d 100644 --- a/drivers/staging/ccree/ssi_aead.c +++ b/drivers/staging/ccree/ssi_aead.c @@ -2720,6 +2720,7 @@ int ssi_aead_alloc(struct ssi_drvdata *drvdata) goto fail0; } + INIT_LIST_HEAD(&aead_handle->aead_list); drvdata->aead_handle = aead_handle; aead_handle->sram_workspace_addr = ssi_sram_mgr_alloc( @@ -2730,8 +2731,6 @@ int ssi_aead_alloc(struct ssi_drvdata *drvdata) goto fail1; } - INIT_LIST_HEAD(&aead_handle->aead_list); - /* Linux crypto */ for (alg = 0; alg < ARRAY_SIZE(aead_algs); alg++) { t_alg = ssi_aead_create_alg(&aead_algs[alg]); |