public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] wifi: mwifiex: fix double free in mwifiex_send_rgpower_table()
@ 2025-09-05  8:02 Dan Carpenter
  2025-09-05  8:32 ` Francesco Dolcini
  2025-09-10 13:10 ` Stefan Kerkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-09-05  8:02 UTC (permalink / raw)
  To: Stefan Kerkmann
  Cc: Brian Norris, Francesco Dolcini, Johannes Berg, Sascha Hauer,
	Jeff Chen, linux-wireless, linux-kernel, kernel-janitors

The "hostcmd" is freed using cleanup.h, so calling kfree() will lead to
a double free.  Delete the kfree().

Fixes: 7b6f16a25806 ("wifi: mwifiex: add rgpower table loading support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
index 6d9e2af29a69..91d5098081e8 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
@@ -1521,10 +1521,8 @@ int mwifiex_send_rgpower_table(struct mwifiex_private *priv, const u8 *data,
 		return -ENOMEM;
 
 	_data = kmemdup(data, size, GFP_KERNEL);
-	if (!_data) {
-		kfree(hostcmd);
+	if (!_data)
 		return -ENOMEM;
-	}
 
 	pos = _data;
 	ptr = hostcmd->cmd;
-- 
2.47.2


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

end of thread, other threads:[~2025-09-10 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05  8:02 [PATCH next] wifi: mwifiex: fix double free in mwifiex_send_rgpower_table() Dan Carpenter
2025-09-05  8:32 ` Francesco Dolcini
2025-09-10 13:10 ` Stefan Kerkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox