Message ID | 1565774919-31853-6-git-send-email-wangzhou1@hisilicon.com |
---|---|
State | Accepted |
Commit | 1ed2002f891dc1082eb110eaafccfde96d327aa3 |
Headers | show |
Series | crypto: hisilicon: Misc fixes | expand |
diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c index 3033513..5a3f84d 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);
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> --- drivers/crypto/hisilicon/zip/zip_crypto.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.8.1