[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221208121448.2845986-1-shaozhengchao@huawei.com>
Date: Thu, 8 Dec 2022 20:14:48 +0800
From: Zhengchao Shao <shaozhengchao@...wei.com>
To: <libertas-dev@...ts.infradead.org>,
<linux-wireless@...r.kernel.org>, <netdev@...r.kernel.org>,
<kvalo@...nel.org>, <davem@...emloft.net>, <edumazet@...gle.com>,
<kuba@...nel.org>, <pabeni@...hat.com>
CC: <johannes.berg@...el.com>, <dcbw@...hat.com>,
<linville@...driver.com>, <hs4233@...l.mn-solutions.de>,
<weiyongjun1@...wei.com>, <yuehaibing@...wei.com>,
<shaozhengchao@...wei.com>
Subject: [PATCH] libertas: fix memory leak in lbs_init_adapter()
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@...wei.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
Powered by blists - more mailing lists