crypto: zip - Memory corruption in zip_clear_stats()

There is a typo here.  It should be "stats" instead of "state".  The
impact is that we clear 224 bytes instead of 80 and we zero out memory
that we shouldn't.

Fixes: 09ae5d37e0 ("crypto: zip - Add Compression/Decompression statistics")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Dan Carpenter 2017-03-17 23:46:21 +03:00 committed by Herbert Xu
parent 106d73340f
commit 0d13d8f26c
1 changed files with 1 additions and 1 deletions

View File

@ -530,7 +530,7 @@ static int zip_clear_stats(struct seq_file *s, void *unused)
for (index = 0; index < MAX_ZIP_DEVICES; index++) { for (index = 0; index < MAX_ZIP_DEVICES; index++) {
if (zip_dev[index]) { if (zip_dev[index]) {
memset(&zip_dev[index]->stats, 0, memset(&zip_dev[index]->stats, 0,
sizeof(struct zip_state)); sizeof(struct zip_stats));
seq_printf(s, "Cleared stats for zip %d\n", index); seq_printf(s, "Cleared stats for zip %d\n", index);
} }
} }