From patchwork Mon Nov 19 19:53:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 10689363 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 EF0E26C5 for ; Mon, 19 Nov 2018 19:53:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E20F82A32B for ; Mon, 19 Nov 2018 19:53:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D65FB2A4DE; Mon, 19 Nov 2018 19:53:48 +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 7B26E2A528 for ; Mon, 19 Nov 2018 19:53:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730087AbeKTGS4 (ORCPT ); Tue, 20 Nov 2018 01:18:56 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45774 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730579AbeKTGSz (ORCPT ); Tue, 20 Nov 2018 01:18:55 -0500 Received: by mail-wr1-f68.google.com with SMTP id v6so11504680wrr.12 for ; Mon, 19 Nov 2018 11:53:44 -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=A5a0kaCamd7puQ3IQhqzNyGRLI0r9dWbNiiEA0+95daGbIySMj1K/dqH8m5oGomgdg 9NdTQMQrsifveYvTwqESzqArGOaUi3JaMOPsiY+K2rlxXkHw+ftCAa+dDP9TvPjGBCqv OzieJSf/p9GBusTbO7wrCw4ZqmiMpQIOr+yfBJpLgPQvcjUUSUQ2WR2Le0Vyu/dTMgHQ NqKpvJ0Y+Hx2nFBvgeq7fDyKIAMolZHTvA48htjaWxaTdeJ09j2aEodiaEpZuaIZpZEl XRm4A+SmeUh3OdV0UwgZUdgFjBnpHIzwiPPd+WKQtsCTIOecI+gHgzlJmSVmkr2JFAsk ViKw== 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=a7YS9cDeEKKf/JQXOVY5mOFBY2t9DHSYD+/htKmFP+UGrlrQeBdpoUrJGY9b0IO3BT i+QP3g0wsXdnKimtYWKxmaaqT29YAn7lV8OYyDrVtO3TCMnP5a4sr4r1jgCKOirddUZ0 h8CD7Iai7J1Ok0FkrFYwCXt+MGWNKGZhLaykcz0J7nW6bg9t2MjI8Nz8rm25/yeRyvbg H2VrMLiN+5Lv4xLbeN8OtZ4MqMtqReGWati+odYwe4GRoDv8flnTBQAfvthAppGOzmSu CldnDP0bjsqBHeuQ4rgwPgPVwX6MzUhg3z7tK4rQLqXuyUPdXnQljTgy8dZ0j3OBROAK K3TA== X-Gm-Message-State: AA+aEWZuCH1PsgAcZOFcOtJ8kG3J/o14NB6hzzWbrzn8hfje+k/qwrlK E0YoyIXrPopLnAdQo09LWUg4kQ== X-Google-Smtp-Source: AFSGD/W6rCLxq767chWSW6S0IxLwMgmutKcv+j0vs6sQY1ajHgybqZq+/0tiIVPg6R3gUrM7NUoVsw== X-Received: by 2002:a5d:4382:: with SMTP id i2mr16119103wrq.172.1542657224173; Mon, 19 Nov 2018 11:53:44 -0800 (PST) Received: from localhost.localdomain ([51.15.160.169]) by smtp.googlemail.com with ESMTPSA id i16sm22954132wmd.28.2018.11.19.11.53.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Nov 2018 11:53:43 -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 v2 08/11] crypto: crypto_user_stat: Fix invalid stat reporting Date: Mon, 19 Nov 2018 19:53:27 +0000 Message-Id: <1542657210-37739-9-git-send-email-clabbe@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542657210-37739-1-git-send-email-clabbe@baylibre.com> References: <1542657210-37739-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);