Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 29fb462c authored by Wei Wang's avatar Wei Wang Committed by Michael Bestas
Browse files

scsi: ufs: call single_release to avoid memory leak



Bug: 110044919
Bug: 139911623
Test: Build
Change-Id: I9fa83b84cf52a54c24405f2416f8747a20901d3f
Signed-off-by: default avatarWei Wang <wvw@google.com>
Signed-off-by: default avatarLeo Liou <leoliou@google.com>
parent 1d8adc37
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -390,6 +390,7 @@ static const struct file_operations ufsdbg_err_inj_scenario_ops = {
	.open		= ufsdbg_err_inj_scenario_open,
	.read		= seq_read,
	.write		= ufsdbg_err_inj_scenario_write,
	.release        = single_release,
};

static int ufsdbg_err_inj_stats_read(struct seq_file *file, void *data)
@@ -431,6 +432,7 @@ static const struct file_operations ufsdbg_err_inj_stats_ops = {
	.open		= ufsdbg_err_inj_stats_open,
	.read		= seq_read,
	.write		= ufsdbg_err_inj_stats_write,
	.release        = single_release,
};

static void ufsdbg_setup_fault_injection(struct ufs_hba *hba)
@@ -614,6 +616,7 @@ static const struct file_operations ufsdbg_tag_stats_fops = {
	.open		= ufsdbg_tag_stats_open,
	.read		= seq_read,
	.write		= ufsdbg_tag_stats_write,
	.release        = single_release,
};

static int ufsdbg_query_stats_show(struct seq_file *file, void *data)
@@ -685,6 +688,7 @@ static const struct file_operations ufsdbg_query_stats_fops = {
	.open		= ufsdbg_query_stats_open,
	.read		= seq_read,
	.write		= ufsdbg_query_stats_write,
	.release        = single_release,
};

static int ufsdbg_err_stats_show(struct seq_file *file, void *data)
@@ -789,6 +793,7 @@ static const struct file_operations ufsdbg_err_stats_fops = {
	.open		= ufsdbg_err_stats_open,
	.read		= seq_read,
	.write		= ufsdbg_err_stats_write,
	.release        = single_release,
};

static int ufshcd_init_statistics(struct ufs_hba *hba)
@@ -868,6 +873,7 @@ static int ufsdbg_host_regs_open(struct inode *inode, struct file *file)
static const struct file_operations ufsdbg_host_regs_fops = {
	.open		= ufsdbg_host_regs_open,
	.read		= seq_read,
	.release        = single_release,
};

static int ufsdbg_dump_device_desc_show(struct seq_file *file, void *data)
@@ -1032,6 +1038,7 @@ static int ufsdbg_show_hba_open(struct inode *inode, struct file *file)
static const struct file_operations ufsdbg_show_hba_fops = {
	.open		= ufsdbg_show_hba_open,
	.read		= seq_read,
	.release	= single_release,
};

static int ufsdbg_dump_device_desc_open(struct inode *inode, struct file *file)
@@ -1043,6 +1050,7 @@ static int ufsdbg_dump_device_desc_open(struct inode *inode, struct file *file)
static const struct file_operations ufsdbg_dump_device_desc = {
	.open		= ufsdbg_dump_device_desc_open,
	.read		= seq_read,
	.release	= single_release,
};

static int ufsdbg_power_mode_show(struct seq_file *file, void *data)
@@ -1330,6 +1338,7 @@ static const struct file_operations ufsdbg_power_mode_desc = {
	.open		= ufsdbg_power_mode_open,
	.read		= seq_read,
	.write		= ufsdbg_power_mode_write,
	.release	= single_release,
};

static int ufsdbg_dme_read(void *data, u64 *attr_val, bool peer)
@@ -1509,6 +1518,7 @@ static const struct file_operations ufsdbg_req_stats_desc = {
	.open		= ufsdbg_req_stats_open,
	.read		= seq_read,
	.write		= ufsdbg_req_stats_write,
	.release        = single_release,
};

static int ufsdbg_clear_err_state(void *data, u64 val)
+3 −0
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ static const struct file_operations ufs_qcom_dbg_testbus_cfg_desc = {
	.open		= ufs_qcom_dbg_testbus_cfg_open,
	.read		= seq_read,
	.write		= ufs_qcom_dbg_testbus_cfg_write,
	.release	= single_release,
};

static int ufs_qcom_dbg_testbus_bus_read(void *data, u64 *attr_val)
@@ -242,6 +243,7 @@ static int ufs_qcom_dbg_dbg_regs_open(struct inode *inode,
static const struct file_operations ufs_qcom_dbg_dbg_regs_desc = {
	.open		= ufs_qcom_dbg_dbg_regs_open,
	.read		= seq_read,
	.release	= single_release,
};

static int ufs_qcom_dbg_pm_qos_show(struct seq_file *file, void *data)
@@ -275,6 +277,7 @@ static int ufs_qcom_dbg_pm_qos_open(struct inode *inode,
static const struct file_operations ufs_qcom_dbg_pm_qos_desc = {
	.open		= ufs_qcom_dbg_pm_qos_open,
	.read		= seq_read,
	.release	= single_release,
};

void ufs_qcom_dbg_add_debugfs(struct ufs_hba *hba, struct dentry *root)
+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ const struct file_operations ufs_test_ ## test_name ## _ops = { \
	.open = ufs_test_ ## test_name ## _open,			\
	.read = seq_read,						\
	.write = ufs_test_ ## test_name ## _write,			\
	.release = single_release,					\
}

#define add_test(utd, test_name, upper_case_name)			\