net: wwan: iosm: Fix memory leak in ipc_mux_deinit()
[ Upstream commit 92e6e0a87f6860a4710f9494f8c704d498ae60f8 ] Commit1f52d7b622("net: wwan: iosm: Enable M.2 7360 WWAN card support") allocated memory for pp_qlt in ipc_mux_init() but did not free it in ipc_mux_deinit(). This results in a memory leak when the driver is unloaded. Free the allocated memory in ipc_mux_deinit() to fix the leak. Fixes:1f52d7b622("net: wwan: iosm: Enable M.2 7360 WWAN card support") Co-developed-by: Jianhao Xu <jianhao.xu@seu.edu.cn> Signed-off-by: Jianhao Xu <jianhao.xu@seu.edu.cn> Signed-off-by: Zilin Guan <zilin@seu.edu.cn> Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com> Link: https://patch.msgid.link/20251230071853.1062223-1-zilin@seu.edu.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f2c4bcfa19
commit
8181c79757
|
|
@ -456,6 +456,7 @@ void ipc_mux_deinit(struct iosm_mux *ipc_mux)
|
|||
struct sk_buff_head *free_list;
|
||||
union mux_msg mux_msg;
|
||||
struct sk_buff *skb;
|
||||
int i;
|
||||
|
||||
if (!ipc_mux->initialized)
|
||||
return;
|
||||
|
|
@ -479,5 +480,10 @@ void ipc_mux_deinit(struct iosm_mux *ipc_mux)
|
|||
ipc_mux->channel->dl_pipe.is_open = false;
|
||||
}
|
||||
|
||||
if (ipc_mux->protocol != MUX_LITE) {
|
||||
for (i = 0; i < IPC_MEM_MUX_IP_SESSION_ENTRIES; i++)
|
||||
kfree(ipc_mux->ul_adb.pp_qlt[i]);
|
||||
}
|
||||
|
||||
kfree(ipc_mux);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue