Skip to content

Commit 1ed2002

Browse files
Zhou Wangherbertx
authored andcommitted
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: 62c455c ("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>
1 parent 902f0ba commit 1ed2002

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/crypto/hisilicon/zip/zip_crypto.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,10 @@ static int hisi_zip_create_req_q(struct hisi_zip_ctx *ctx)
223223
sizeof(long), GFP_KERNEL);
224224
if (!req_q->req_bitmap) {
225225
ret = -ENOMEM;
226-
if (i == 1)
227-
goto err_free_loop0;
226+
if (i == 0)
227+
return ret;
228+
229+
goto err_free_loop0;
228230
}
229231
rwlock_init(&req_q->req_lock);
230232

0 commit comments

Comments
 (0)