wifi: libertas: fix memory leak in lbs_init_adapter()
authorZhengchao Shao <shaozhengchao@huawei.com>
Thu, 8 Dec 2022 12:14:48 +0000 (20:14 +0800)
committerKalle Valo <kvalo@kernel.org>
Wed, 14 Dec 2022 12:22:22 +0000 (14:22 +0200)
commit16a03958618fb91bb1bc7077cf3211055162cc2f
tree25b70b1e900c5aad06f7f0ec942cdf072cb9cf09
parent0c1528675d7a9787cb516b64d8f6c0f6f8efcb48
wifi: 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@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
drivers/net/wireless/marvell/libertas/main.c