Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtlwifi: Fix file release memory leak

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: 610247f46feb ("rtlwifi: Improve debugging by using debugfs")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Wei Yongjun and committed by
Kalle Valo
4c3e4879 eb9affae

+1 -1
+1 -1
drivers/net/wireless/realtek/rtlwifi/debug.c
··· 88 88 .open = dl_debug_open_common, 89 89 .read = seq_read, 90 90 .llseek = seq_lseek, 91 - .release = seq_release, 91 + .release = single_release, 92 92 }; 93 93 94 94 static int rtl_debug_get_mac_page(struct seq_file *m, void *v)