From patchwork Thu Nov 29 14:42:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 10704683 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5292117F0 for ; Thu, 29 Nov 2018 14:44:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4342D2F302 for ; Thu, 29 Nov 2018 14:44:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33DD92F2DB; Thu, 29 Nov 2018 14:44:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 739EC2F1D6 for ; Thu, 29 Nov 2018 14:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729394AbeK3Bth (ORCPT ); Thu, 29 Nov 2018 20:49:37 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34874 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388355AbeK3BsR (ORCPT ); Thu, 29 Nov 2018 20:48:17 -0500 Received: by mail-wr1-f67.google.com with SMTP id 96so2177185wrb.2 for ; Thu, 29 Nov 2018 06:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iV/M8EbvN8TGuValOiY6W/51UjKDNEJVorUmBNxwOt4=; b=EZKclkcIg9CYEkoPTu7sIoWZGAueSY9R6zJ/j1l317hooPMp2n5beQBYdP508+ST/c tm0oaQOCDgDvAs0HUPDBtSJyHnsz+ysc8sQi9CIA99J8LFG+/q5i9sICNKNyMtXgJ/+f V/K3MP/tUqT9vbo2ezKS38pTBjNUJtClBqKUxurzJ6qtzfk9wzacsZBX46gobJCqHUf/ eNW7sB7XLbH8CbJqnnyZ00NsGG6QY8tuh7mmliteMHX/cuhZyMpe2Q1lDPdGUU+IrmFx OV1ZyLeGNDgl43WbkSuXJ6UFWVeKluN1m6fnLGfyVoPw6n7A1FXswMBCr7y5EBajeeEs QtBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iV/M8EbvN8TGuValOiY6W/51UjKDNEJVorUmBNxwOt4=; b=rrPzliEgxXpaH/FGmkxdX90EvzCjd+uFOtiXUCf5IavvCkNZTboOh399ZlhJjprUI1 iYx96BZED9RZxkq2/ElPiNA0ohf8+tZvdL0Et5GFQFv4vkRvdRjNF1f3tKPZWQVDvvjS N/PiIePlep7B8FClQ3FnyqI/KMIwfAinp7LTfAKhPp4Thc9rRN7pqcMqL+xGWDQPTlyo Ck3f8WvpE46wejpO5koJLIYM2A8rcYsbzv/Qo43F94pLKI0LQjX1FRc9F/Md8rEKdyY+ PJs7mFhVdTzDFihT/hpMYtZr+d8molUTniC5mu4U7xo3XBI3hDiCJ752kYebpFTEue2h 8PCQ== X-Gm-Message-State: AA+aEWbda56yddF7uQ79ofSVTTxthH3T9VqO3vWM5Kmaqouik36slsZM SsXnVoXJB6TsKxkERFnhJ8JS7g== X-Google-Smtp-Source: AFSGD/UFoFx5vXv6veaLQmsLBGgvlh+XqIoI73Fxb/TsQmmfCdQOvCUcjWpnWxN6H9Jy0YKZcS4Jzg== X-Received: by 2002:adf:e488:: with SMTP id i8mr1746046wrm.10.1543502560975; Thu, 29 Nov 2018 06:42:40 -0800 (PST) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id t131sm875406wmt.1.2018.11.29.06.42.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Nov 2018 06:42:40 -0800 (PST) From: Corentin Labbe To: davem@davemloft.net, ebiggers@kernel.org, herbert@gondor.apana.org.au, nhorman@tuxdriver.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH v5 07/11] crypto: crypto_user_stat: Fix invalid stat reporting Date: Thu, 29 Nov 2018 14:42:22 +0000 Message-Id: <1543502546-23870-8-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543502546-23870-1-git-send-email-clabbe@baylibre.com> References: <1543502546-23870-1-git-send-email-clabbe@baylibre.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some error count use the wrong name for getting this data. But this had not caused any reporting problem, since all error count are shared in the same union. Signed-off-by: Corentin Labbe --- crypto/crypto_user_stat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/crypto_user_stat.c b/crypto/crypto_user_stat.c index 3c14be2f7a1b..838123758423 100644 --- a/crypto/crypto_user_stat.c +++ b/crypto/crypto_user_stat.c @@ -93,7 +93,7 @@ static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg) rcomp.stat_decompress_cnt = v64; v64 = atomic64_read(&alg->decompress_tlen); rcomp.stat_decompress_tlen = v64; - v64 = atomic64_read(&alg->cipher_err_cnt); + v64 = atomic64_read(&alg->compress_err_cnt); rcomp.stat_compress_err_cnt = v64; return nla_put(skb, CRYPTOCFGA_STAT_COMPRESS, sizeof(rcomp), &rcomp); @@ -115,7 +115,7 @@ static int crypto_report_acomp(struct sk_buff *skb, struct crypto_alg *alg) racomp.stat_decompress_cnt = v64; v64 = atomic64_read(&alg->decompress_tlen); racomp.stat_decompress_tlen = v64; - v64 = atomic64_read(&alg->cipher_err_cnt); + v64 = atomic64_read(&alg->compress_err_cnt); racomp.stat_compress_err_cnt = v64; return nla_put(skb, CRYPTOCFGA_STAT_ACOMP, sizeof(racomp), &racomp); @@ -222,7 +222,7 @@ static int crypto_report_rng(struct sk_buff *skb, struct crypto_alg *alg) rrng.stat_generate_tlen = v64; v64 = atomic64_read(&alg->seed_cnt); rrng.stat_seed_cnt = v64; - v64 = atomic64_read(&alg->hash_err_cnt); + v64 = atomic64_read(&alg->rng_err_cnt); rrng.stat_rng_err_cnt = v64; return nla_put(skb, CRYPTOCFGA_STAT_RNG, sizeof(rrng), &rrng);