mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 14:12:06 +00:00
net: mhi: Fix memory leak in mhi_net_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 calls free_netdev() to fix it since netdev_priv
is used after unregister.
Fixes: 13adac0329
("net: mhi_net: Register wwan_ops for link creation")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3738d48b9b
commit
f7c125bd79
@ -343,6 +343,8 @@ static void mhi_net_dellink(struct mhi_device *mhi_dev, struct net_device *ndev)
|
||||
|
||||
kfree_skb(mhi_netdev->skbagg_head);
|
||||
|
||||
free_netdev(ndev);
|
||||
|
||||
dev_set_drvdata(&mhi_dev->dev, NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user