Skip to content

Commit

Permalink
crypto: hisilicon - fix error handle in hisi_zip_create_req_q
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zhou Wang authored and Herbert Xu committed Aug 15, 2019
1 parent 902f0ba commit 1ed2002
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/crypto/hisilicon/zip/zip_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1ed2002

Please sign in to comment.