]> git.baikalelectronics.ru Git - kernel.git/commit
net: wwan: mhi: fix memory leak in mhi_mbim_dellink
authorHW He <hw.he@mediatek.com>
Thu, 3 Nov 2022 10:54:19 +0000 (18:54 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Nov 2022 09:38:04 +0000 (09:38 +0000)
commit0e9060a7371f87aef7d5255bc6f66738a170361a
tree671ac5823eb4c3b3cd3fd2bc150a91c143c0b344
parentdaf2c5b42a7ff9f97b4f9d45323c605106940af4
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: 1565afe1f014 ("net: wwan: Add MHI MBIM network driver")
Signed-off-by: HW He <hw.he@mediatek.com>
Signed-off-by: Zhaoping Shu <zhaoping.shu@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wwan/mhi_wwan_mbim.c