Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: wwan: iosm: Fix memory leak in ipc_mux_deinit()

Commit 1f52d7b62285 ("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: 1f52d7b62285 ("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>

authored by

Zilin Guan and committed by
Jakub Kicinski
92e6e0a8 8da901ff

+6
+6
drivers/net/wwan/iosm/iosm_ipc_mux.c
··· 456 456 struct sk_buff_head *free_list; 457 457 union mux_msg mux_msg; 458 458 struct sk_buff *skb; 459 + int i; 459 460 460 461 if (!ipc_mux->initialized) 461 462 return; ··· 478 477 if (ipc_mux->channel) { 479 478 ipc_mux->channel->ul_pipe.is_open = false; 480 479 ipc_mux->channel->dl_pipe.is_open = false; 480 + } 481 + 482 + if (ipc_mux->protocol != MUX_LITE) { 483 + for (i = 0; i < IPC_MEM_MUX_IP_SESSION_ENTRIES; i++) 484 + kfree(ipc_mux->ul_adb.pp_qlt[i]); 481 485 } 482 486 483 487 kfree(ipc_mux);