Skip to content

Commit c552ffb

Browse files
Wei Yongjunherbertx
authored andcommitted
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: 09ae5d3 ("crypto: zip - Add Compression/Decompression statistics") Cc: <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 18a0bb4 commit c552ffb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/crypto/cavium/zip/zip_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ static const struct file_operations zip_stats_fops = {
593593
.owner = THIS_MODULE,
594594
.open = zip_stats_open,
595595
.read = seq_read,
596+
.release = single_release,
596597
};
597598

598599
static int zip_clear_open(struct inode *inode, struct file *file)
@@ -604,6 +605,7 @@ static const struct file_operations zip_clear_fops = {
604605
.owner = THIS_MODULE,
605606
.open = zip_clear_open,
606607
.read = seq_read,
608+
.release = single_release,
607609
};
608610

609611
static int zip_regs_open(struct inode *inode, struct file *file)
@@ -615,6 +617,7 @@ static const struct file_operations zip_regs_fops = {
615617
.owner = THIS_MODULE,
616618
.open = zip_regs_open,
617619
.read = seq_read,
620+
.release = single_release,
618621
};
619622

620623
/* Root directory for thunderx_zip debugfs entry */

0 commit comments

Comments
 (0)