Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] rtlwifi: Fix file release memory leak
@ 2019-09-04 14:16 Wei Yongjun
  2019-09-06 14:11 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2019-09-04 14:16 UTC (permalink / raw)
  To: Ping-Ke Shih, Kalle Valo; +Cc: Wei Yongjun, linux-wireless, kernel-janitors

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>
---
 drivers/net/wireless/realtek/rtlwifi/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.c b/drivers/net/wireless/realtek/rtlwifi/debug.c
index a051de16284d..55db71c766fe 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.c
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.c
@@ -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)




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtlwifi: Fix file release memory leak
  2019-09-04 14:16 [PATCH] rtlwifi: Fix file release memory leak Wei Yongjun
@ 2019-09-06 14:11 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2019-09-06 14:11 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Ping-Ke Shih, Wei Yongjun, linux-wireless, kernel-janitors

Wei Yongjun <weiyongjun1@huawei.com> wrote:

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

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

4c3e48794dec rtlwifi: Fix file release memory leak

-- 
https://patchwork.kernel.org/patch/11130357/

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 14:16 [PATCH] rtlwifi: Fix file release memory leak Wei Yongjun
2019-09-06 14:11 ` Kalle Valo

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org linux-wireless@archiver.kernel.org
	public-inbox-index linux-wireless


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/ public-inbox