mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
wifi: libertas: fix memory leak in lbs_init_adapter()
[ Upstream commit 16a03958618fb91bb1bc7077cf3211055162cc2f ]
When kfifo_alloc() failed in lbs_init_adapter(), cmd buffer is not
released. Add free memory to processing error path.
Fixes: 7919b89c82 ("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>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221208121448.2845986-1-shaozhengchao@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1864b22e23
commit
23b34e08de
1 changed files with 1 additions and 0 deletions
|
|
@ -870,6 +870,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue