From patchwork Mon Apr 1 12:54:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Debieve X-Patchwork-Id: 161536 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp423688jan; Mon, 1 Apr 2019 05:54:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmjTDmrd+9Brf9tBf+DCphZXsAo01jba/BWr1IikhfyvjEEjLy3y/RPegEHtfB4EOKd20R X-Received: by 2002:a17:902:b94a:: with SMTP id h10mr36164343pls.82.1554123288435; Mon, 01 Apr 2019 05:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554123288; cv=none; d=google.com; s=arc-20160816; b=fzRi5LiHRMymAZ3WTzQtUvrk5uzbeRbzpq+Pi1Ge5lXNoI81AYT2Kh9CEZMYC499Oo uhZ+76uo5SbE235bZSU20lNYy6QCOXy5hKCriVZCUN1hd8elj5HiBIp+5MhD6gb5/0nX 9Eq/s9uLZ0KyhwYa54d09nh2La5JjN+V6UswgZKc6IdhlFbYR3zdY0LBhr1JqbVZX6SV +AIWF7A3enlmD9M5L+S6yC4kFnvlzPS1e6gO2hD+Dlo3rIWnha+ArWVvBNCV8kaz8Qrs pSotfBoT9qSM/SaaB/soib//opQFSWNgde8OuI+DGxTg6IBleUaVWqgQc+ncNMCAVADH 3bcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=V11SKIdjJjVgzjLm2j1ZQ1vHZyg626sX6LMX+tI3gZs=; b=Q1tiQox30hAx2yt7z8zz1bJrzZrMQNrzE7zcL/vdV8XtyxgWoZtuiuBJVq6ic6cOLt GF+bRABCZA1xn2yDw2PH2z9BjTCay4jrSkw1kBQoKvzckbYwrgtVA/FX68lVvVHalA7i gXjgVN0iKqgophfSFbhl4UO9VhraG4Sor0o9S87wNWaYb2hXCavSHaugUEwFHEQLMByG 1on18u8LqOST0tBVcmZEiKojK18Qpdq1LLrXPqbOjJidd6JX3pG3GSM74LwyLMpJeVvH o25LfsMdSFhS6ZbKQf24kZjCeZiNJMSJMGsc0/H1mohUkd+gJ59/Dr0MEHCMd+r6MqGZ KvlA== 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 t18si4442828plo.113.2019.04.01.05.54.48; Mon, 01 Apr 2019 05:54:48 -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 S1726752AbfDAMyr (ORCPT + 3 others); Mon, 1 Apr 2019 08:54:47 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:46911 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725882AbfDAMyr (ORCPT ); Mon, 1 Apr 2019 08:54:47 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x31CpA2n030648; Mon, 1 Apr 2019 14:54:26 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2rjee285pb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 01 Apr 2019 14:54:26 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C16CE38; Mon, 1 Apr 2019 12:54:25 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 640A0290A; Mon, 1 Apr 2019 12:54:25 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 1 Apr 2019 14:54:25 +0200 Received: from localhost (10.201.23.65) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Mon, 1 Apr 2019 14:54:25 +0200 From: Lionel Debieve To: Herbert Xu , "David S . Miller" , Maxime Coquelin , "Alexandre Torgue" , , , CC: Benjamin Gaignard , Fabien Dessenne , Ludovic Barre , Subject: [PATCH 1/1] crypto: testmgr - call shash_init in crc32c algo Date: Mon, 1 Apr 2019 14:54:24 +0200 Message-ID: <1554123264-24243-1-git-send-email-lionel.debieve@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.201.23.65] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-01_05:, , signatures=0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org In case of device call required in low level driver, the context must be initialized before calling the final function. Signed-off-by: Lionel Debieve --- crypto/testmgr.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 8386038..4a00d7c 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -2181,6 +2181,13 @@ static int alg_test_crc32c(const struct alg_test_desc *desc, shash->tfm = tfm; shash->flags = 0; + err = crypto_shash_init(shash); + if (err) { + printk(KERN_ERR "alg: crc32c: init failed for " + "%s: %d\n", driver, err); + break; + } + *ctx = 420553207; err = crypto_shash_final(shash, (u8 *)&val); if (err) {