Skip to contentSkip to conversation

rtlwifi: Fix file release memory leak

PATCH In review Wei Yongjun 2 participants 2 messages Sep 4, 2019 – Sep 6, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/wireless/realtek/rtlwifi/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/debug.c +1 -1
index a051de16284d..55db71c766fe 100644
@@ -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)
#1 lore raw
Quoted 7 lines · Wei Yongjun

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")

Patch applied to wireless-drivers-next.git, thanks.

4c3e48794dec rtlwifi: Fix file release memory leak

Signature · 3 lines
https://patchwork.kernel.org/patch/11130357/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches