Skip to contentSkip to conversation

crypto: cavium/zip - Add missing single_release()

PATCH In review Wei Yongjun 2 participants 2 messages Sep 4, 2019 – Sep 9, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: cavium/zip - Add missing single_release()

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")
---
 drivers/crypto/cavium/zip/zip_main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/crypto/cavium/zip/zip_main.c +3 -0
index a8447a3cf366..194624b4855b 100644
@@ -593,6 +593,7 @@ static const struct file_operations zip_stats_fops = {
 	.owner = THIS_MODULE,
 	.open  = zip_stats_open,
 	.read  = seq_read,
+	.release = single_release,
 };
 
 static int zip_clear_open(struct inode *inode, struct file *file)
@@ -604,6 +605,7 @@ static const struct file_operations zip_clear_fops = {
 	.owner = THIS_MODULE,
 	.open  = zip_clear_open,
 	.read  = seq_read,
+	.release = single_release,
 };
 
 static int zip_regs_open(struct inode *inode, struct file *file)
@@ -615,6 +617,7 @@ static const struct file_operations zip_regs_fops = {
 	.owner = THIS_MODULE,
 	.open  = zip_regs_open,
 	.read  = seq_read,
+	.release = single_release,
 };
 
 /* Root directory for thunderx_zip debugfs entry */
maintainer
#1 lore raw
Quoted 8 lines · Wei Yongjun

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")
---
 drivers/crypto/cavium/zip/zip_main.c | 3 +++
 1 file changed, 3 insertions(+)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt