aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wwan/iosm/iosm_ipc_wwan.c
diff options
context:
space:
mode:
authorHW He <hw.he@mediatek.com>2022-11-03 18:40:00 +0800
committerDavid S. Miller <davem@davemloft.net>2022-11-07 09:36:56 +0000
commitf25caaca424703d5a0607310f0452f978f1f78d9 (patch)
treef3ba3acdaf6fbe0f4e83f036f5e2ec882644f618 /drivers/net/wwan/iosm/iosm_ipc_wwan.c
parenthamradio: fix issue of dev reference count leakage in bpq_device_event() (diff)
downloadlinux-dev-f25caaca424703d5a0607310f0452f978f1f78d9.tar.xz
linux-dev-f25caaca424703d5a0607310f0452f978f1f78d9.zip
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: 2a54f2c77934 ("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>
Diffstat (limited to '')
-rw-r--r--drivers/net/wwan/iosm/iosm_ipc_wwan.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wwan/iosm/iosm_ipc_wwan.c b/drivers/net/wwan/iosm/iosm_ipc_wwan.c
index 2f1f8b5d5b59..0108d8d01ff2 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_wwan.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_wwan.c
@@ -168,6 +168,7 @@ static void ipc_wwan_setup(struct net_device *iosm_dev)
iosm_dev->max_mtu = ETH_MAX_MTU;
iosm_dev->flags = IFF_POINTOPOINT | IFF_NOARP;
+ iosm_dev->needs_free_netdev = true;
iosm_dev->netdev_ops = &ipc_inm_ops;
}