From patchwork Mon Jul 19 14:50:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 479845 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4203365jao; Mon, 19 Jul 2021 07:57:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMXZnmuLBfwngVNq9R160x911q7uewu97BFIiGqCs7UtASScTI4FoK6Zx4QYFcUTz6+pZZ X-Received: by 2002:a02:866b:: with SMTP id e98mr22694734jai.48.1626706679629; Mon, 19 Jul 2021 07:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626706679; cv=none; d=google.com; s=arc-20160816; b=SoPOcpzpIFoATcli8MkveO7DPgPEyXPIOwO+dl3OSsyLhoZUfvZwCgC1TVdKtc73uV C3taUAlcSCPzPfrUpQcCM9HbbGE+BJlA67VQAHc8mqJSeq5Lj6zvSLJodur5mx6Dm38B rvrh0b7genfdsymOnSZyZbmG35R36aVZzJv0wmB35xPHr3vqrW7mCIBhF3ABPGPPpHzt Ib8YAIAgKzAN5Qj6JXIU/Vr5byHnp09oj4J/m/q1GdeOI13kFQWurYvkuA7wasZUkDUx IsmdusRhEaOSwSSAFFXyA+EXkq5dv2wwI/c6PQA1zvfRm8PfUnNMCWQ5hH24TkKKadlV ya8w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KOZk/cc7tlqmAs9oDsT4rfYiqMh4zM6AUZ3zkUo4+Ow=; b=TLAqlLTAN0oRPH4lwp3Hd9IO2iwmrPWXK1IA2Z5Ay8UhMjIHqLiILpcIxqpsJCo3Xu J0m1qVRiWFAYEGIfnQopzNUOnx97vGBreQclaHYxA1ShtWSTXUqREi5v2S5X8Qi92FsJ +kaN72DezEyRF4/mhAv5r2jb/YLL9TuuM7BnxceVY2L7aLNB1Csng+p5tfIW4I4ljWlV K8fNy/LAbyhyor51DgbTddRSQR4yZSFotqeJ1QUfAkH/7CV2gz0hqBG05VHrgg+13HDj aLsfay14CgdGykLDzA9D4ffy47RPxe1fuHl5HqazfN6K7yafCIFXosH9jFZLeGqpLsZ1 TkLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OtcuksGN; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si2768811iot.18.2021.07.19.07.57.59; Mon, 19 Jul 2021 07:57:59 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OtcuksGN; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241838AbhGSORR (ORCPT + 12 others); Mon, 19 Jul 2021 10:17:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:50972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232228AbhGSORO (ORCPT ); Mon, 19 Jul 2021 10:17:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F5E261002; Mon, 19 Jul 2021 14:57:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626706673; bh=pbceKYoL/21pVLCdAxzz/fbK1oJbY9ZYqXVvE4Bop2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OtcuksGNXwI2xtSxc/J+teP0CgOQ0YDTVYoK9IuEujIuU45dUTTkqV5Ybox43wfZs 3x1QL4mYqT1oLCgy4nL65rzID52f7EUEnwlNoNb/5V7mEtAn3DkgkOxBALP/+rK9cn UOfoh7bSSGS87rb/ugYRPcUcSpzpHs9KQbaMAY7w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhen Lei , Linus Walleij , Herbert Xu , Sasha Levin Subject: [PATCH 4.4 049/188] crypto: ux500 - Fix error return code in hash_hw_final() Date: Mon, 19 Jul 2021 16:50:33 +0200 Message-Id: <20210719144924.433416478@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144913.076563739@linuxfoundation.org> References: <20210719144913.076563739@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zhen Lei [ Upstream commit b01360384009ab066940b45f34880991ea7ccbfb ] 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 Reviewed-by: Linus Walleij Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/ux500/hash/hash_core.c | 1 + 1 file changed, 1 insertion(+) -- 2.30.2 diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index bca6b701c067..7021b5b49c03 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1022,6 +1022,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;