mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
memleek: using single_open/seq_read and single_release in pair
PD#149178: memleek when single_open/seq_readwithout single_release single_open/seq_read will apply for one page and two small slab memory. If we do not release them in single_release, the system will crash for memory leeking Change-Id: I2b74a0c6faec415e96164d0c20ba0676836e55eb Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
This commit is contained in:
@@ -779,11 +779,13 @@ static const struct file_operations bluesleep_proc_readwrite_fops = {
|
||||
.open = bluesleep_proc_open,
|
||||
.read = seq_read,
|
||||
.write = bluesleep_proc_write,
|
||||
.release = single_release,
|
||||
};
|
||||
static const struct file_operations bluesleep_proc_read_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = bluesleep_proc_open,
|
||||
.read = seq_read,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -636,6 +636,7 @@ static const struct file_operations clkmsr_file_ops = {
|
||||
.read = seq_read,
|
||||
.write = clkmsr_write,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static int aml_clkmsr_probe(struct platform_device *pdev)
|
||||
|
||||
@@ -252,6 +252,7 @@ static const struct file_operations dtb_ops = {
|
||||
.read = mmc_dtb_read,
|
||||
.write = mmc_dtb_write,
|
||||
.unlocked_ioctl = mmc_dtb_ioctl,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
int amlmmc_dtb_init(struct mmc_card *card)
|
||||
@@ -737,7 +738,7 @@ static const struct file_operations card_proc_fops = {
|
||||
.open = card_proc_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static int add_emmc_partition(struct gendisk *disk,
|
||||
|
||||
@@ -178,6 +178,7 @@ static const struct file_operations dump_file_ops = {
|
||||
.read = seq_read,
|
||||
.write = dump_write_file,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
static int __init aml_debug_init(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user