Skip to content

Commit 92e6e0a

Browse files
GoodLuck612kuba-moo
authored andcommitted
net: wwan: iosm: Fix memory leak in ipc_mux_deinit()
Commit 1f52d7b ("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: 1f52d7b ("net: wwan: iosm: Enable M.2 7360 WWAN card support") Co-developed-by: Jianhao Xu <[email protected]> Signed-off-by: Jianhao Xu <[email protected]> Signed-off-by: Zilin Guan <[email protected]> Reviewed-by: Loic Poulain <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8da901f commit 92e6e0a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/net/wwan/iosm/iosm_ipc_mux.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ void ipc_mux_deinit(struct iosm_mux *ipc_mux)
456456
struct sk_buff_head *free_list;
457457
union mux_msg mux_msg;
458458
struct sk_buff *skb;
459+
int i;
459460

460461
if (!ipc_mux->initialized)
461462
return;
@@ -479,5 +480,10 @@ void ipc_mux_deinit(struct iosm_mux *ipc_mux)
479480
ipc_mux->channel->dl_pipe.is_open = false;
480481
}
481482

483+
if (ipc_mux->protocol != MUX_LITE) {
484+
for (i = 0; i < IPC_MEM_MUX_IP_SESSION_ENTRIES; i++)
485+
kfree(ipc_mux->ul_adb.pp_qlt[i]);
486+
}
487+
482488
kfree(ipc_mux);
483489
}

0 commit comments

Comments
 (0)