Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Cc: <stable@vger.kernel.org>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Wei Yongjun and committed by
Herbert Xu
c552ffb5 18a0bb4a

+3
+3
drivers/crypto/cavium/zip/zip_main.c
··· 593 593 .owner = THIS_MODULE, 594 594 .open = zip_stats_open, 595 595 .read = seq_read, 596 + .release = single_release, 596 597 }; 597 598 598 599 static int zip_clear_open(struct inode *inode, struct file *file) ··· 605 604 .owner = THIS_MODULE, 606 605 .open = zip_clear_open, 607 606 .read = seq_read, 607 + .release = single_release, 608 608 }; 609 609 610 610 static int zip_regs_open(struct inode *inode, struct file *file) ··· 617 615 .owner = THIS_MODULE, 618 616 .open = zip_regs_open, 619 617 .read = seq_read, 618 + .release = single_release, 620 619 }; 621 620 622 621 /* Root directory for thunderx_zip debugfs entry */