Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp568102ybl; Wed, 14 Aug 2019 02:31:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxohEGQKOP73tEeFgLn0XuSAxmnMsD4M40HuVlTKPdj8pfkAp5KXlXi1pScO1kVnxwNWQG X-Received: by 2002:a62:e109:: with SMTP id q9mr12083986pfh.71.1565775092112; Wed, 14 Aug 2019 02:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565775092; cv=none; d=google.com; s=arc-20160816; b=c32wCKqI0A7s2EPSanwSWH0GX9MzQFmMZxpsLRDxpj1XZ/17otJegkTjEH1spgVNFz hGzYE4ZwH2DUULsOyUUK7MjKxYnvF78aoCXOZ1oLGlQd6M9nq0GCVwopZkI7PKciV2/2 9NLBW4hh3yuCeNpBdyQMrEG73phbUpRZ8+igiqEjb5b2Le6u3Tczkt/euLvoKfHUpL07 8P5sHPXWnPei9Qa9sITpCd9vkOm6zfUIxsO/ts1oFGGKyScvNj+vX3qwkZnG5KM7pMWl CN+2vROSOFF42zgmDqLdkzLimZlKPV2U1wilHSlynin08f8jkKZ0VFzMr10BzrAScaBp yZfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=ULXL2SYCpkHz14dNfbdNi7rogbW/bJ9lQWHlUqXNqJU=; b=O6iOvE08e0XgO+AN1aW8bL1cjtnfOw+097HQTl70v44NFrg/VR9iS3R+fXvOgsbqci SFVd7YSmpU9ogo53jSohRKnMTexzn5CMn3890REWmVecJ3VL5DxGGW0mgMQjpe6Be5kR FWY1nlb9OhsmgDQ45qsH8vB2miZDyNHHOeBspZgRJYU4WRHxGl+KeDG3YSzsrszUHKct L0p9dG1+XvdoNE7RKmXvHTcNBKvpLfIBfYaJve9ogGex0SPH/bdqGZqELIl5LBVU1RbX rCP5NP6qTdLLbBSzQdkGll9rzw99Y5r2P57xh5y5Yr4aWbNmqQvZo/0vAMfULJ+s31CP nn1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16si62212782pgl.318.2019.08.14.02.31.18; Wed, 14 Aug 2019 02:31:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727110AbfHNJbF (ORCPT + 99 others); Wed, 14 Aug 2019 05:31:05 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:44814 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726998AbfHNJbE (ORCPT ); Wed, 14 Aug 2019 05:31:04 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 4AD07D03B26C8358703B; Wed, 14 Aug 2019 17:31:01 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Wed, 14 Aug 2019 17:30:50 +0800 From: Zhou Wang To: , CC: , , , Zhou Wang Subject: [PATCH 5/5] crypto: hisilicon - fix error handle in hisi_zip_create_req_q Date: Wed, 14 Aug 2019 17:28:39 +0800 Message-ID: <1565774919-31853-6-git-send-email-wangzhou1@hisilicon.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1565774919-31853-1-git-send-email-wangzhou1@hisilicon.com> References: <1565774919-31853-1-git-send-email-wangzhou1@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- drivers/crypto/hisilicon/zip/zip_crypto.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 2.8.1