blob: be64ceb3f4e6b5cce7d488f88a8a4a012ce986f8 [file] [log] [blame]
From 9f8ede4ccd508fa613126379dac8704ff5b500c9 Mon Sep 17 00:00:00 2001
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Wed, 4 Sep 2019 14:16:01 +0000
Subject: [PATCH] rtw88: fix seq_file memory leak
commit eb9affaeff701ce90fcf476ff5332624f9d0ddd2 upstream.
When using single_open(), single_release() should be used instead
of seq_release(), otherwise there is a memory leak.
This is detected by Coccinelle semantic patch.
Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
index f0ae26018f97..a7d45f4d34c4 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -76,7 +76,7 @@ static const struct file_operations file_ops_single_r = {
.open = rtw_debugfs_single_open_rw,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = single_release,
};
static const struct file_operations file_ops_single_rw = {
--
2.27.0