Skip to content

Commit

Permalink
rtlwifi: Fix file release memory leak
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1864060

[ Upstream commit 4c3e487 ]

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: 610247f ("rtlwifi: Improve debugging by using debugfs")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
  • Loading branch information
Wei Yongjun authored and smb49 committed Mar 27, 2020
1 parent 6be24f9 commit de8857b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/realtek/rtlwifi/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static const struct file_operations file_ops_common = {
.open = dl_debug_open_common,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
.release = single_release,
};

static int rtl_debug_get_mac_page(struct seq_file *m, void *v)
Expand Down

0 comments on commit de8857b

Please sign in to comment.