From patchwork Mon Jul 12 06:08:44 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: 472837 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2643145jao; Sun, 11 Jul 2021 23:22:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwqI9JqZEA2kXNabMHFLKncvL5zpZNcDZAj5d0wABbR1bTlrGdggNkSEiHMmN+nT7HIweK X-Received: by 2002:a17:907:3f0c:: with SMTP id hq12mr46027524ejc.117.1626070933410; Sun, 11 Jul 2021 23:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626070933; cv=none; d=google.com; s=arc-20160816; b=LL2VuKOPzT1f/GR83sSpg0gx3gLyEFDiBXlAmERnSx4tQ2oI5ZIrYL82Bvl0IVWP9o v0dmSiCDhVCSMWYSADXqJFCs/Eqweda/A7m55c7l8jnPQDRBABhmjkh7ye7mr1BFDoGS sQQCOIzeubbO62HEcis3efKRHofjwnOJuIYO6d1lxu6oLSdp7kJvFjdmoQKRXLMpltBL ZLnjjxcOYFrGi0CMkS98TnRp35amz3XD5KJnsQpi3yLSpEm8rjW7mmfSD2LFDajEHgcL dtJ7BEVsw47d1FlQFqpRyd7xRmgGReM+NgZ0IIyhfJEGUeYa/jy6h8oI9nkvha9xvwva Oybw== 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=U52ueLAsJvqeqo4hdzA67301y25HrXAuFRraEROkNGE=; b=ykku7ZQWyhaaQik+1kPlfqkxb6aWUazXXEI/tr5223R/MX3QMp7+nd0cmMqzZWp2PM RvZpXh9dBboFMwn72ye4vqxRmSy7bpuGWr8ZgFVoAZ1q07/EtGVHr1DSwnWNeHDx/WC/ zTd96lcE0M48XVZVt1dla3b+SlRe1kaa45E2zFnQDmlmKb2ABrS2UWePKvFJzMBCkVap i43Ac7IAGGPNulv2/fld7Q2ZyRj5uwCp5PJscLO9ndU+ZXXNoTqIPjpnqLPle+zktLOW 89mhHDYh5wHTRFODs4JJJLAT3v7lhjA9RsTdvyOzCwMO518333bNs+qn8MZZc3cN5K9S o2YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tlEltDCp; 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 dn7si8190642ejc.635.2021.07.11.23.22.13; Sun, 11 Jul 2021 23:22:13 -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=tlEltDCp; 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 S233762AbhGLGYx (ORCPT + 12 others); Mon, 12 Jul 2021 02:24:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:38730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234028AbhGLGXJ (ORCPT ); Mon, 12 Jul 2021 02:23:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E3A0C610F7; Mon, 12 Jul 2021 06:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626070787; bh=3a4KX2UFLcCf6+az1inOuMsVptP/nCjvvBe8G8zPsEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tlEltDCps32yXSxGBhJT0zCogO8fUGonjKcayJf1VBHsqeVgbzM/5xt1mJn/EP8Uz nyWLkhnYyV82zyBv3Z2uV4lI9BdtWkc58FygFLF/nQXSBxPo78XczN+jCir1AChPn5 iE6zvD+Qg9VVeHEzfiagWHsA8D2TkegAx1TgPuH4= 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.4 140/348] crypto: ux500 - Fix error return code in hash_hw_final() Date: Mon, 12 Jul 2021 08:08:44 +0200 Message-Id: <20210712060719.748981620@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@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 c172a6953477..38a66aceca2a 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1009,6 +1009,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;