From patchwork Sat May 8 07:00:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 432599 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp1008515jao; Sat, 8 May 2021 00:01:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysucsrYLDTmyk1AEWGErzl/b7lI2eUg63yiVzw3Q5kTPoLJUhSPCOwPvWRwc5qn0NHGf1z X-Received: by 2002:a05:6402:350d:: with SMTP id b13mr16483701edd.21.1620457269778; Sat, 08 May 2021 00:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620457269; cv=none; d=google.com; s=arc-20160816; b=O4O9k00dtyj7Nbs18oylyf7A8b9+I9x6VMMbhpHX76yl9G4mPZiPrRW5ydeFVg1bdZ OjAJwXI53hdqj10Yt0XReFoImUbfKx9cNOdDeqnmxtgNdbxIfeW9m8KoL3u0ftAR909Y d8Kzy60UB1dW0piS8XODIfUMMxHKVOo403iD+spjwySvbF6PmrbID6ThbtycAnQJjrmE hCEy/+fVM1wC71Ahs+qva3EN9V1fPJtL0+ZP+V4ZZTnVOpUGDPR8a4BwSog/4uCQThOE tIQL3yhcZn3WUOZ5+pr/iBP9S7GQwO7lS8de2FCuJlpkgJUoAMnS0Q/xKK8JJhX/ELCQ KXJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=OMifMnh33kJSRGfBoIsiDzqYuNA3HePVfrbdqcSTwiA=; b=xwgR0JAOGXetwVyg6+xUgtScpFHPlWZa8S7hp9lufOwvBG4OC5SX0tDS9ThGALsacP SrAL0dbNaNYQS/3K0meWTjL6+fogIr4H6MAqtXy1vKDgD+3gNEAJZXrWqs/VG0K1WfH3 TrUfq4e1P5mMy3iVJely5qxiWEhaKrnRvgLFubgJRkI9d/v17B6yR0LkN3Zk1xTE1kM2 ICogpOq4acTL7jsWlS/LVx97kpmnyIxqNDGDrja+F6YAeCxR4f4O1/1JZne6NxYjH5Zn +0F9zjWTNfeAve/wxS03IhXocOE+yFa4YC3R23Rbd6hsE767fCa5Rd6OWeFrTMITl6xg QTyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si7059710eja.217.2021.05.08.00.01.09; Sat, 08 May 2021 00:01:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229583AbhEHHCJ (ORCPT + 3 others); Sat, 8 May 2021 03:02:09 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:17483 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbhEHHCI (ORCPT ); Sat, 8 May 2021 03:02:08 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FcdSj6TbvzkXfC; Sat, 8 May 2021 14:58:29 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Sat, 8 May 2021 15:00:56 +0800 From: Zhen Lei To: Herbert Xu , "David S . Miller" , Andreas Westin , "Linus Walleij" , linux-crypto , linux-kernel CC: Zhen Lei Subject: [PATCH 1/1] crypto: ux500 - Fix error return code in hash_hw_final() Date: Sat, 8 May 2021 15:00:49 +0800 Message-ID: <20210508070049.2674-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 8a63b1994c50 ("crypto: ux500 - Add driver for HASH hardware") Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/crypto/ux500/hash/hash_core.c | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 Reviewed-by: Linus Walleij diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index ecb7412e84e3..51a6e1a42434 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1011,6 +1011,7 @@ static int hash_hw_final(struct ahash_request *req) goto out; } } else if (req->nbytes == 0 && ctx->keylen > 0) { + ret = -EPERM; dev_err(device_data->dev, "%s: Empty message with keylength > 0, NOT supported\n", __func__); goto out;