* [PATCH] libertas: fix memory leak in lbs_init_adapter()
@ 2022-12-08 12:14 Zhengchao Shao
2022-12-08 12:52 ` Jiri Pirko
2022-12-14 12:22 ` wifi: " Kalle Valo
0 siblings, 2 replies; 4+ messages in thread
From: Zhengchao Shao @ 2022-12-08 12:14 UTC (permalink / raw)
To: libertas-dev, linux-wireless, netdev, kvalo, davem, edumazet,
kuba, pabeni
Cc: johannes.berg, dcbw, linville, hs4233, weiyongjun1, yuehaibing,
shaozhengchao
When kfifo_alloc() failed in lbs_init_adapter(), cmd buffer is not
released. Add free memory to processing error path.
Fixes: 7919b89c8276 ("libertas: convert libertas driver to use an event/cmdresp queue")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
drivers/net/wireless/marvell/libertas/main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/marvell/libertas/main.c b/drivers/net/wireless/marvell/libertas/main.c
index 8f5220cee112..ae975304cfcf 100644
--- a/drivers/net/wireless/marvell/libertas/main.c
+++ b/drivers/net/wireless/marvell/libertas/main.c
@@ -869,6 +869,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
ret = kfifo_alloc(&priv->event_fifo, sizeof(u32) * 16, GFP_KERNEL);
if (ret) {
pr_err("Out of memory allocating event FIFO buffer\n");
+ lbs_free_cmd_buffer(priv);
goto out;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] libertas: fix memory leak in lbs_init_adapter()
2022-12-08 12:14 [PATCH] libertas: fix memory leak in lbs_init_adapter() Zhengchao Shao
@ 2022-12-08 12:52 ` Jiri Pirko
2022-12-14 12:22 ` wifi: " Kalle Valo
1 sibling, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2022-12-08 12:52 UTC (permalink / raw)
To: Zhengchao Shao
Cc: libertas-dev, linux-wireless, netdev, kvalo, davem, edumazet,
kuba, pabeni, johannes.berg, dcbw, linville, hs4233, weiyongjun1,
yuehaibing
Thu, Dec 08, 2022 at 01:14:48PM CET, shaozhengchao@huawei.com wrote:
>When kfifo_alloc() failed in lbs_init_adapter(), cmd buffer is not
>released. Add free memory to processing error path.
>
>Fixes: 7919b89c8276 ("libertas: convert libertas driver to use an event/cmdresp queue")
>Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: wifi: libertas: fix memory leak in lbs_init_adapter()
2022-12-08 12:14 [PATCH] libertas: fix memory leak in lbs_init_adapter() Zhengchao Shao
2022-12-08 12:52 ` Jiri Pirko
@ 2022-12-14 12:22 ` Kalle Valo
2022-12-30 1:02 ` Info Skymem
1 sibling, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2022-12-14 12:22 UTC (permalink / raw)
To: Zhengchao Shao
Cc: libertas-dev, linux-wireless, netdev, davem, edumazet, kuba,
pabeni, johannes.berg, dcbw, linville, hs4233, weiyongjun1,
yuehaibing, shaozhengchao
Zhengchao Shao <shaozhengchao@huawei.com> wrote:
> When kfifo_alloc() failed in lbs_init_adapter(), cmd buffer is not
> released. Add free memory to processing error path.
>
> Fixes: 7919b89c8276 ("libertas: convert libertas driver to use an event/cmdresp queue")
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Patch applied to wireless-next.git, thanks.
16a03958618f wifi: libertas: fix memory leak in lbs_init_adapter()
--
https://patchwork.kernel.org/project/linux-wireless/patch/20221208121448.2845986-1-shaozhengchao@huawei.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: wifi: libertas: fix memory leak in lbs_init_adapter()
2022-12-14 12:22 ` wifi: " Kalle Valo
@ 2022-12-30 1:02 ` Info Skymem
0 siblings, 0 replies; 4+ messages in thread
From: Info Skymem @ 2022-12-30 1:02 UTC (permalink / raw)
To: Kalle Valo
Cc: Zhengchao Shao, libertas-dev, linux-wireless, netdev, davem,
edumazet, kuba, pabeni, johannes.berg, dcbw, linville, hs4233,
weiyongjun1, yuehaibing
Hi,
thank you for your information.
On our website you can find email addresses of companies and people.
https://www.skymem.info
In short, it’s like Google for emails.
Best regards,
Robert,
Skymem team
On Wed, Dec 14, 2022 at 1:23 PM Kalle Valo <kvalo@kernel.org> wrote:
>
> Zhengchao Shao <shaozhengchao@huawei.com> wrote:
>
> > When kfifo_alloc() failed in lbs_init_adapter(), cmd buffer is not
> > released. Add free memory to processing error path.
> >
> > Fixes: 7919b89c8276 ("libertas: convert libertas driver to use an event/cmdresp queue")
> > Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> > Reviewed-by: Jiri Pirko <jiri@nvidia.com>
>
> Patch applied to wireless-next.git, thanks.
>
> 16a03958618f wifi: libertas: fix memory leak in lbs_init_adapter()
>
> --
> https://patchwork.kernel.org/project/linux-wireless/patch/20221208121448.2845986-1-shaozhengchao@huawei.com/
>
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
>
>
> _______________________________________________
> libertas-dev mailing list
> libertas-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-30 1:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-08 12:14 [PATCH] libertas: fix memory leak in lbs_init_adapter() Zhengchao Shao
2022-12-08 12:52 ` Jiri Pirko
2022-12-14 12:22 ` wifi: " Kalle Valo
2022-12-30 1:02 ` Info Skymem
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).