diff mbox series

rtw88: fix seq_file memory leak

Message ID 20190904141601.186107-1-weiyongjun1@huawei.com (mailing list archive)
State Accepted
Commit eb9affaeff701ce90fcf476ff5332624f9d0ddd2
Delegated to: Kalle Valo
Headers show
Series rtw88: fix seq_file memory leak | expand

Commit Message

Wei Yongjun Sept. 4, 2019, 2:16 p.m. UTC
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>
---
 drivers/net/wireless/realtek/rtw88/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Sept. 6, 2019, 2:10 p.m. UTC | #1
Wei Yongjun <weiyongjun1@huawei.com> wrote:

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

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

eb9affaeff70 rtw88: fix seq_file memory leak
diff mbox series

Patch

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 = {