wifi: rsi: Fix memory leak in rsi_coex_attach()
authorYuan Can <yuancan@huawei.com>
Mon, 5 Dec 2022 06:14:41 +0000 (06:14 +0000)
committerKalle Valo <kvalo@kernel.org>
Wed, 14 Dec 2022 12:19:41 +0000 (14:19 +0200)
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>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221205061441.114632-1-yuancan@huawei.com
drivers/net/wireless/rsi/rsi_91x_coex.c

index 8a3d86897ea8ec8b3fa9e1973ae4d17a427ded32..45ac9371f262161efb233a4958d24d838564faff 100644 (file)
@@ -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;