Skip to content

Commit

Permalink
crypto: cavium/zip - Add missing single_release()
Browse files Browse the repository at this point in the history
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: <stable@vger.kernel.org>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Wei Yongjun authored and Herbert Xu committed Sep 9, 2019
1 parent 18a0bb4 commit c552ffb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/crypto/cavium/zip/zip_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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 */
Expand Down

0 comments on commit c552ffb

Please sign in to comment.