Commit f25caaca authored by HW He's avatar HW He Committed by David S. Miller

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: 2a54f2c7 ("net: iosm: net driver")
Signed-off-by: default avatarHW He <hw.he@mediatek.com>
Reviewed-by: default avatarLoic Poulain <loic.poulain@linaro.org>
Signed-off-by: default avatarZhaoping Shu <zhaoping.shu@mediatek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 85cbaf03
...@@ -168,6 +168,7 @@ static void ipc_wwan_setup(struct net_device *iosm_dev) ...@@ -168,6 +168,7 @@ static void ipc_wwan_setup(struct net_device *iosm_dev)
iosm_dev->max_mtu = ETH_MAX_MTU; iosm_dev->max_mtu = ETH_MAX_MTU;
iosm_dev->flags = IFF_POINTOPOINT | IFF_NOARP; iosm_dev->flags = IFF_POINTOPOINT | IFF_NOARP;
iosm_dev->needs_free_netdev = true;
iosm_dev->netdev_ops = &ipc_inm_ops; iosm_dev->netdev_ops = &ipc_inm_ops;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment