mwifiex: fix memory leak issue when driver unload
authorAmitkumar Karwar <[email protected]>
Tue, 7 May 2013 02:46:54 +0000 (19:46 -0700)
committerJohn W. Linville <[email protected]>
Wed, 8 May 2013 21:15:08 +0000 (17:15 -0400)
commitf16fdc9d2dc1e5b270e9a08377587e831e0d36ac
tree44f4aec9e330308b99af023cde45f031f7e284e6
parent48795424acff7215d5eac0b52793a2c1eb3a6283
mwifiex: fix memory leak issue when driver unload

After unregister_netdevice() call the request is queued and
reg_state is changed to NETREG_UNREGISTERING.
As we check for NETREG_UNREGISTERED state, free_netdev() never
gets executed causing memory leak.

Initialize "dev->destructor" to free_netdev() to free device
data after unregistration.

Cc: <[email protected]>
Reported-by: Daniel Drake <[email protected]>
Tested-by: Daniel Drake <[email protected]>
Signed-off-by: Amitkumar Karwar <[email protected]>
Signed-off-by: Bing Zhao <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/wireless/mwifiex/main.c