Skip to content

Commit

Permalink
crypto: user - Fix invalid stat reporting
Browse files Browse the repository at this point in the history
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 <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Corentin Labbe authored and Herbert Xu committed Dec 7, 2018
1 parent f7d76e0 commit b0af91c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crypto/crypto_user_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b0af91c

Please sign in to comment.