diff options
author | Zhou Wang <wangzhou1@hisilicon.com> | 2019-08-14 11:28:39 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-08-15 13:52:13 +0200 |
commit | 1ed2002f891dc1082eb110eaafccfde96d327aa3 (patch) | |
tree | b9631fcdbe87443155c720d0e82a160a2ae5be20 /drivers/crypto/hisilicon/zip/zip_crypto.c | |
parent | crypto: hisilicon - add missing single_release (diff) | |
download | linux-1ed2002f891dc1082eb110eaafccfde96d327aa3.tar.xz linux-1ed2002f891dc1082eb110eaafccfde96d327aa3.zip |
crypto: hisilicon - fix error handle in hisi_zip_create_req_q
Directly return error in the first loop in hisi_zip_create_req_q.
Fixes: 62c455ca853e ("crypto: hisilicon - add HiSilicon ZIP accelerator support")
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/hisilicon/zip/zip_crypto.c')
-rw-r--r-- | drivers/crypto/hisilicon/zip/zip_crypto.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c index 303351325a58..5a3f84dcdcde 100644 --- a/drivers/crypto/hisilicon/zip/zip_crypto.c +++ b/drivers/crypto/hisilicon/zip/zip_crypto.c @@ -223,8 +223,10 @@ static int hisi_zip_create_req_q(struct hisi_zip_ctx *ctx) sizeof(long), GFP_KERNEL); if (!req_q->req_bitmap) { ret = -ENOMEM; - if (i == 1) - goto err_free_loop0; + if (i == 0) + return ret; + + goto err_free_loop0; } rwlock_init(&req_q->req_lock); |