rtw88: fix seq_file memory leak
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 4 Sep 2019 14:16:01 +0000 (14:16 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 6 Sep 2019 14:10:33 +0000 (17:10 +0300)
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>
drivers/net/wireless/realtek/rtw88/debug.c

index 5d235968d4758f977d6a182cbb656e95eb5467cf..6ad985e98e425d8abfee8d3cf27d299b4cbac4eb 100644 (file)
@@ -77,7 +77,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 = {