linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] wifi: mwifiex: fix memory leak in mwifiex_histogram_read()
@ 2023-07-26  7:20 Dmitry Antipov
  2023-07-26  7:20 ` [PATCH 2/5] wifi: mwifiex: drop BUG_ON() from TX error handling Dmitry Antipov
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Dmitry Antipov @ 2023-07-26  7:20 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Brian Norris, linux-wireless, lvc-project, Dmitry Antipov

Always free the zeroed page on return from 'mwifiex_histogram_read()'.

Fixes: cbf6e05527a7 ("mwifiex: add rx histogram statistics support")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
NOTE: this series supersedes all of the previous mwifiex patches not
yet accepted into wireless-next tree.
---
 drivers/net/wireless/marvell/mwifiex/debugfs.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c b/drivers/net/wireless/marvell/mwifiex/debugfs.c
index 52b18f4a774b..0cdd6c50c1c0 100644
--- a/drivers/net/wireless/marvell/mwifiex/debugfs.c
+++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c
@@ -253,8 +253,11 @@ mwifiex_histogram_read(struct file *file, char __user *ubuf,
 	if (!p)
 		return -ENOMEM;
 
-	if (!priv || !priv->hist_data)
-		return -EFAULT;
+	if (!priv || !priv->hist_data) {
+		ret = -EFAULT;
+		goto free_and_exit;
+	}
+
 	phist_data = priv->hist_data;
 
 	p += sprintf(p, "\n"
@@ -309,6 +312,8 @@ mwifiex_histogram_read(struct file *file, char __user *ubuf,
 	ret = simple_read_from_buffer(ubuf, count, ppos, (char *)page,
 				      (unsigned long)p - page);
 
+free_and_exit:
+	free_page(page);
 	return ret;
 }
 
-- 
2.41.0


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

end of thread, other threads:[~2023-08-21 15:56 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-26  7:20 [PATCH 1/5] wifi: mwifiex: fix memory leak in mwifiex_histogram_read() Dmitry Antipov
2023-07-26  7:20 ` [PATCH 2/5] wifi: mwifiex: drop BUG_ON() from TX error handling Dmitry Antipov
2023-07-26 19:22   ` Brian Norris
2023-07-26  7:20 ` [PATCH 3/5] wifi: mwifiex: cleanup private data structures Dmitry Antipov
2023-07-26  7:20 ` [PATCH 4/5] wifi: mwifiex: handle possible sscanf() errors Dmitry Antipov
2023-07-26  7:20 ` [PATCH 5/5] wifi: mwifiex: handle possible mwifiex_write_reg() errors Dmitry Antipov
2023-07-26 19:24 ` [PATCH 1/5] wifi: mwifiex: fix memory leak in mwifiex_histogram_read() Brian Norris
2023-07-28  8:43   ` [PATCH 1/5] [v2] " Dmitry Antipov
2023-07-28  8:43     ` [PATCH 2/2] [v2] wifi: mwifiex: cleanup TX error handling Dmitry Antipov
2023-08-01 17:55       ` Brian Norris
2023-08-02 11:45         ` [lvc-project] " Antipov, Dmitriy
2023-08-02 16:07         ` [PATCH 1/5] [v3] wifi: mwifiex: fix memory leak in mwifiex_histogram_read() Dmitry Antipov
2023-08-02 16:07           ` [PATCH 2/5] [v3] wifi: mwifiex: cleanup private data structures Dmitry Antipov
2023-08-02 16:07           ` [PATCH 3/5] [v3] wifi: mwifiex: handle possible sscanf() errors Dmitry Antipov
2023-08-02 16:07           ` [PATCH 4/5] [v3] wifi: mwifiex: handle possible mwifiex_write_reg() errors Dmitry Antipov
2023-08-02 16:07           ` [PATCH 5/5] [v3] wifi: mwifiex: drop BUG_ON from TX paths Dmitry Antipov
2023-08-08 19:58             ` Brian Norris
2023-08-21 15:56           ` [PATCH 1/5] [v3] wifi: mwifiex: fix memory leak in mwifiex_histogram_read() Kalle Valo
2023-07-28  8:43     ` [PATCH 3/5] [v2] wifi: mwifiex: cleanup private data structures Dmitry Antipov
2023-07-28  8:43     ` [PATCH 4/5] [v2] wifi: mwifiex: handle possible sscanf() errors Dmitry Antipov
2023-07-28  8:43     ` [PATCH 5/5] [v2] wifi: mwifiex: handle possible mwifiex_write_reg() errors Dmitry Antipov
2023-07-31  9:46     ` [PATCH 1/5] [v2] wifi: mwifiex: fix memory leak in mwifiex_histogram_read() Kalle Valo
2023-07-31  9:55       ` [lvc-project] " Antipov, Dmitriy
2023-07-28  9:29   ` [lvc-project] [PATCH 1/5] " Antipov, Dmitriy
2023-07-31  9:47     ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).