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

Commit 641aa99e authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: Call single_release to avoid memory leak"

parents fd5d3aad 9c7751a0
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -389,6 +389,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)
@@ -430,6 +431,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,
};


@@ -1557,6 +1567,7 @@ static const struct file_operations ufsdbg_reset_controller = {
	.open		= ufsdbg_reset_controller_open,
	.read		= seq_read,
	.write		= ufsdbg_reset_controller_write,
	.release	= single_release,
};

static int ufsdbg_clear_err_state(void *data, u64 val)
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015,2017, Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2019 Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -186,6 +186,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)
@@ -240,6 +241,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)
@@ -273,6 +275,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)
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -74,6 +74,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)			\