From patchwork Mon Jul 12 06:05:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 472952 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2674470jao; Mon, 12 Jul 2021 00:11:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7svX6Xr+iSzSxv2MNEmWHXL/eKk9oQ1lb9HOQ/mcR6fOLKojcEWxz2gwd0HVQTDvk5wXK X-Received: by 2002:a92:b00b:: with SMTP id x11mr37350890ilh.130.1626073887659; Mon, 12 Jul 2021 00:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626073887; cv=none; d=google.com; s=arc-20160816; b=0UqbnpWklUl2hct839bDXtsB15H6WQUFdseUpDDhaR72bcV0yAxY7RL0c1OY/zamOw eRkpV3ZBIJAhOSaz/5lhsu/uDABSN6b9ggrpUGm814RpKaI2Xeiuw3N/yARgDZo32eBm uxAvQdUpgnhqR4Q26ldNkdLPtxry43zF4G5wQeboDBhMhLFhEn/MLhXi2S/lmxgRUnXe 6YIbzRFh6PEM0xC5eAT4UcAJDqQJc67AHMykhffFKj5aZ6RJwWNeSdKJvF02S6CRih9k qHoeM8ab9lDECqAiI+Woj2aSKlgcLrTPpFbhbdatOSnycryJjH4cu1o95tUgRxwrTHcd osLw== 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=bbpKRya7SWcq1jyxLS7OkJiJsXjK2OGPUscu+m5D+mU=; b=HpOmbE/BwETR4KO0qSOmggGMEN0sFcIIPolSRnnSKw5ANBjL1JZgv75cIjAKKEDrkn Q+LAc92Cq8xB81E/Jxx62kSy9WlEcIVwBs1JmpJCUW58UzQ3Gnt0saBr4tlvtY1/5KPE 9wcOlU9eX4ntUPBi2Qk65LFFr/86wVjLQuKFwmxUrrnEY/nYuSaOc/cqRnt8L4PXs3tL T3YgieArm+KH+YCU+iQ1titp0uOScVmOW4ZfjWUu1f7Ig35KsA2iDsQEWaeeOL9Q9GYI JsdUbs/q6fB/T/ONC4yauzXmK2oirzfpG1aPexKLztIVBGjWFY4AFDfaXjX9T1O6aihN nhBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="lqxDV3Z/"; 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 g12si16580694jas.65.2021.07.12.00.11.27; Mon, 12 Jul 2021 00:11:27 -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="lqxDV3Z/"; 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 S242377AbhGLHM4 (ORCPT + 12 others); Mon, 12 Jul 2021 03:12:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:42764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244235AbhGLHKb (ORCPT ); Mon, 12 Jul 2021 03:10:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 961C260FE7; Mon, 12 Jul 2021 07:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626073639; bh=3KBamJziqWM1gjAHRVWgeK8tl5GhP7KQcl75Bslf1q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lqxDV3Z/fQfUza1da4RlzNRtrpgcwFAc+Ac1EZV+KQMPjGYcIMf3UygYMGmnwK9Hv XYl/+VbfDc6rpOzTNX/q+zmBpbpmt53P/gXLj2NWXTq6WI+Xpvp1GFKymMNxOx/Y+h 6GrEkg2Pb7nFWaIJmrDNbtMx48dNLxLWG2VMIB9s= 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 5.12 256/700] crypto: ux500 - Fix error return code in hash_hw_final() Date: Mon, 12 Jul 2021 08:05:39 +0200 Message-Id: <20210712061003.245068477@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@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 da284b0ea1b2..243515df609b 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1010,6 +1010,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;