Commit 16e5d407 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

rtlwifi: Fix file release memory leak

[ Upstream commit 4c3e4879 ]

When using single_open() for opening, single_release() should be
used instead of seq_release(), otherwise there is a memory leak.

This is detected by Coccinelle semantic patch.

Fixes: 610247f4 ("rtlwifi: Improve debugging by using debugfs")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d676203b
...@@ -109,7 +109,7 @@ static const struct file_operations file_ops_common = { ...@@ -109,7 +109,7 @@ static const struct file_operations file_ops_common = {
.open = dl_debug_open_common, .open = dl_debug_open_common,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = seq_release, .release = single_release,
}; };
static int rtl_debug_get_mac_page(struct seq_file *m, void *v) static int rtl_debug_get_mac_page(struct seq_file *m, void *v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment