From: Wei Yongjun <weiyongj...@huawei.com>

commit c552ffb5c93d9d65aaf34f5f001c4e7e8484ced1 upstream.

When using single_open() for opening, single_release() should be
used instead of seq_release(), otherwise there is a memory leak.

Fixes: 09ae5d37e093 ("crypto: zip - Add Compression/Decompression statistics")
Cc: <sta...@vger.kernel.org>
Signed-off-by: Wei Yongjun <weiyongj...@huawei.com>
Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 drivers/crypto/cavium/zip/zip_main.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/crypto/cavium/zip/zip_main.c
+++ b/drivers/crypto/cavium/zip/zip_main.c
@@ -595,6 +595,7 @@ static const struct file_operations zip_
        .owner = THIS_MODULE,
        .open  = zip_stats_open,
        .read  = seq_read,
+       .release = single_release,
 };
 
 static int zip_clear_open(struct inode *inode, struct file *file)
@@ -606,6 +607,7 @@ static const struct file_operations zip_
        .owner = THIS_MODULE,
        .open  = zip_clear_open,
        .read  = seq_read,
+       .release = single_release,
 };
 
 static int zip_regs_open(struct inode *inode, struct file *file)
@@ -617,6 +619,7 @@ static const struct file_operations zip_
        .owner = THIS_MODULE,
        .open  = zip_regs_open,
        .read  = seq_read,
+       .release = single_release,
 };
 
 /* Root directory for thunderx_zip debugfs entry */


Reply via email to