]> git.baikalelectronics.ru Git - kernel.git/commit
net: wwan: iosm: fix memory leak in ipc_wwan_dellink
authorHW He <hw.he@mediatek.com>
Thu, 3 Nov 2022 10:40:00 +0000 (18:40 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Nov 2022 09:36:56 +0000 (09:36 +0000)
commitdaf2c5b42a7ff9f97b4f9d45323c605106940af4
treef3ba3acdaf6fbe0f4e83f036f5e2ec882644f618
parent295ed8bb29c42fb19eeaf43a59f82a1cbff354c6
net: wwan: iosm: fix memory leak in ipc_wwan_dellink

IOSM driver registers network device without setting the
needs_free_netdev flag, and does NOT call free_netdev() when
unregisters network device, which causes a memory leak.

This patch sets needs_free_netdev to true when registers
network device, which makes netdev subsystem call free_netdev()
automatically after unregister_netdevice().

Fixes: 2b9c90d1efaa ("net: iosm: net driver")
Signed-off-by: HW He <hw.he@mediatek.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Zhaoping Shu <zhaoping.shu@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wwan/iosm/iosm_ipc_wwan.c