]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rtlwifi: Fix file release memory leak
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 4 Sep 2019 14:16:11 +0000 (14:16 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 6 Sep 2019 14:11:36 +0000 (17:11 +0300)
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>
drivers/net/wireless/realtek/rtlwifi/debug.c

index a051de16284dfb2d3965445477458d8708a13292..55db71c766fe3b88e8a3bb0e15f64a62b085dc4e 100644 (file)
@@ -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)