Commit 8db3271c authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Greg Kroah-Hartman

staging: ath6kl: use free_netdev(netdev) instead of kfree()

It is not guaranteed that free_netdev() is macro.
Freeing netdev without free_netdev() leads to net, tx leaks.
I might lead to dereferencing freed pointer.
Signed-off-by: default avatarVasiliy Kulikov <segooon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2166abeb
...@@ -2143,11 +2143,7 @@ ar6000_destroy(struct net_device *dev, unsigned int unregister) ...@@ -2143,11 +2143,7 @@ ar6000_destroy(struct net_device *dev, unsigned int unregister)
unregister_netdev(dev); unregister_netdev(dev);
is_netdev_registered = 0; is_netdev_registered = 0;
} }
#ifndef free_netdev
kfree(dev);
#else
free_netdev(dev); free_netdev(dev);
#endif
#ifdef ATH6K_CONFIG_CFG80211 #ifdef ATH6K_CONFIG_CFG80211
ar6k_cfg80211_deinit(ar); ar6k_cfg80211_deinit(ar);
...@@ -6429,11 +6425,7 @@ A_STATUS ar6000_remove_ap_interface(AR_SOFTC_T *ar) ...@@ -6429,11 +6425,7 @@ A_STATUS ar6000_remove_ap_interface(AR_SOFTC_T *ar)
ar6000_stop_ap_interface(ar); ar6000_stop_ap_interface(ar);
unregister_netdev(arApNetDev); unregister_netdev(arApNetDev);
#ifndef free_netdev
kfree(arApNetDev);
#else
free_netdev(apApNetDev); free_netdev(apApNetDev);
#endif
A_PRINTF("Remove AP interface\n"); A_PRINTF("Remove AP interface\n");
} }
......
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