OSDN Git Service

crypto: hisilicon - fix error handle in hisi_zip_create_req_q
authorZhou Wang <wangzhou1@hisilicon.com>
Wed, 14 Aug 2019 09:28:39 +0000 (17:28 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 15 Aug 2019 11:52:13 +0000 (21:52 +1000)
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>
drivers/crypto/hisilicon/zip/zip_crypto.c

index 3033513..5a3f84d 100644 (file)
@@ -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);