netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rsi: Fix memory leak in rsi_coex_attach()
@ 2022-12-05  6:14 Yuan Can
  2022-12-08 14:27 ` Simon Horman
  2022-12-14 12:19 ` wifi: " Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Yuan Can @ 2022-12-05  6:14 UTC (permalink / raw)
  To: amitkarwar, siva8118, kvalo, davem, edumazet, kuba, pabeni,
	prameela.j04cs, linux-wireless, netdev
  Cc: yuancan

The coex_cb needs to be freed when rsi_create_kthread() failed in
rsi_coex_attach().

Fixes: 2108df3c4b18 ("rsi: add coex support")
Signed-off-by: Yuan Can <yuancan@huawei.com>
---
 drivers/net/wireless/rsi/rsi_91x_coex.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rsi/rsi_91x_coex.c b/drivers/net/wireless/rsi/rsi_91x_coex.c
index 8a3d86897ea8..45ac9371f262 100644
--- a/drivers/net/wireless/rsi/rsi_91x_coex.c
+++ b/drivers/net/wireless/rsi/rsi_91x_coex.c
@@ -160,6 +160,7 @@ int rsi_coex_attach(struct rsi_common *common)
 			       rsi_coex_scheduler_thread,
 			       "Coex-Tx-Thread")) {
 		rsi_dbg(ERR_ZONE, "%s: Unable to init tx thrd\n", __func__);
+		kfree(coex_cb);
 		return -EINVAL;
 	}
 	return 0;
-- 
2.17.1


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

* Re: [PATCH] rsi: Fix memory leak in rsi_coex_attach()
  2022-12-05  6:14 [PATCH] rsi: Fix memory leak in rsi_coex_attach() Yuan Can
@ 2022-12-08 14:27 ` Simon Horman
  2022-12-14 12:19 ` wifi: " Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2022-12-08 14:27 UTC (permalink / raw)
  To: Yuan Can
  Cc: amitkarwar, siva8118, kvalo, davem, edumazet, kuba, pabeni,
	prameela.j04cs, linux-wireless, netdev

On Mon, Dec 05, 2022 at 06:14:41AM +0000, Yuan Can wrote:
> The coex_cb needs to be freed when rsi_create_kthread() failed in
> rsi_coex_attach().
> 
> Fixes: 2108df3c4b18 ("rsi: add coex support")
> Signed-off-by: Yuan Can <yuancan@huawei.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>

> ---
>  drivers/net/wireless/rsi/rsi_91x_coex.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/rsi/rsi_91x_coex.c b/drivers/net/wireless/rsi/rsi_91x_coex.c
> index 8a3d86897ea8..45ac9371f262 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_coex.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_coex.c
> @@ -160,6 +160,7 @@ int rsi_coex_attach(struct rsi_common *common)
>  			       rsi_coex_scheduler_thread,
>  			       "Coex-Tx-Thread")) {
>  		rsi_dbg(ERR_ZONE, "%s: Unable to init tx thrd\n", __func__);
> +		kfree(coex_cb);

I was going to ask if the assignment of coex_cb to common->coex_cb
also needs to be cleaned up. But I see that the caller frees
common on error, so I think this is ok.

>  		return -EINVAL;
>  	}
>  	return 0;
> -- 
> 2.17.1
> 

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

* Re: wifi: rsi: Fix memory leak in rsi_coex_attach()
  2022-12-05  6:14 [PATCH] rsi: Fix memory leak in rsi_coex_attach() Yuan Can
  2022-12-08 14:27 ` Simon Horman
@ 2022-12-14 12:19 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2022-12-14 12:19 UTC (permalink / raw)
  To: Yuan Can
  Cc: amitkarwar, siva8118, davem, edumazet, kuba, pabeni,
	prameela.j04cs, linux-wireless, netdev, yuancan

Yuan Can <yuancan@huawei.com> wrote:

> The coex_cb needs to be freed when rsi_create_kthread() failed in
> rsi_coex_attach().
> 
> Fixes: 2108df3c4b18 ("rsi: add coex support")
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> Reviewed-by: Simon Horman <simon.horman@corigine.com>

Patch applied to wireless-next.git, thanks.

956fb851a6e1 wifi: rsi: Fix memory leak in rsi_coex_attach()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20221205061441.114632-1-yuancan@huawei.com/

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


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

end of thread, other threads:[~2022-12-14 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-05  6:14 [PATCH] rsi: Fix memory leak in rsi_coex_attach() Yuan Can
2022-12-08 14:27 ` Simon Horman
2022-12-14 12:19 ` wifi: " 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).