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

net: wwan: mhi: fix memory leak in mhi_mbim_dellink

MHI 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: aa730a99 ("net: wwan: Add MHI MBIM network driver")
Signed-off-by: default avatarHW He <hw.he@mediatek.com>
Signed-off-by: default avatarZhaoping Shu <zhaoping.shu@mediatek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f25caaca
......@@ -582,6 +582,7 @@ static void mhi_mbim_setup(struct net_device *ndev)
ndev->min_mtu = ETH_MIN_MTU;
ndev->max_mtu = MHI_MAX_BUF_SZ - ndev->needed_headroom;
ndev->tx_queue_len = 1000;
ndev->needs_free_netdev = true;
}
static const struct wwan_ops mhi_mbim_wwan_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