diff options
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 7e417eacbc77..e8555de65762 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -890,6 +890,31 @@ static void command_timer_fn(unsigned long data) | |||
890 | return; | 890 | return; |
891 | } | 891 | } |
892 | 892 | ||
893 | static void libertas_free_adapter(wlan_private * priv) | ||
894 | { | ||
895 | wlan_adapter *adapter = priv->adapter; | ||
896 | |||
897 | if (!adapter) { | ||
898 | lbs_deb_fw("why double free adapter?\n"); | ||
899 | return; | ||
900 | } | ||
901 | |||
902 | lbs_deb_fw("free command buffer\n"); | ||
903 | libertas_free_cmd_buffer(priv); | ||
904 | |||
905 | lbs_deb_fw("free command_timer\n"); | ||
906 | del_timer(&adapter->command_timer); | ||
907 | |||
908 | lbs_deb_fw("free scan results table\n"); | ||
909 | kfree(adapter->networks); | ||
910 | adapter->networks = NULL; | ||
911 | |||
912 | /* Free the adapter object itself */ | ||
913 | lbs_deb_fw("free adapter\n"); | ||
914 | kfree(adapter); | ||
915 | priv->adapter = NULL; | ||
916 | } | ||
917 | |||
893 | static int wlan_allocate_adapter(wlan_private * priv) | 918 | static int wlan_allocate_adapter(wlan_private * priv) |
894 | { | 919 | { |
895 | size_t bufsize; | 920 | size_t bufsize; |
@@ -1009,31 +1034,6 @@ static void wlan_init_adapter(wlan_private * priv) | |||
1009 | return; | 1034 | return; |
1010 | } | 1035 | } |
1011 | 1036 | ||
1012 | void libertas_free_adapter(wlan_private * priv) | ||
1013 | { | ||
1014 | wlan_adapter *adapter = priv->adapter; | ||
1015 | |||
1016 | if (!adapter) { | ||
1017 | lbs_deb_fw("why double free adapter?\n"); | ||
1018 | return; | ||
1019 | } | ||
1020 | |||
1021 | lbs_deb_fw("free command buffer\n"); | ||
1022 | libertas_free_cmd_buffer(priv); | ||
1023 | |||
1024 | lbs_deb_fw("free command_timer\n"); | ||
1025 | del_timer(&adapter->command_timer); | ||
1026 | |||
1027 | lbs_deb_fw("free scan results table\n"); | ||
1028 | kfree(adapter->networks); | ||
1029 | adapter->networks = NULL; | ||
1030 | |||
1031 | /* Free the adapter object itself */ | ||
1032 | lbs_deb_fw("free adapter\n"); | ||
1033 | kfree(adapter); | ||
1034 | priv->adapter = NULL; | ||
1035 | } | ||
1036 | |||
1037 | static int libertas_init_fw(wlan_private * priv) | 1037 | static int libertas_init_fw(wlan_private * priv) |
1038 | { | 1038 | { |
1039 | int ret = -1; | 1039 | int ret = -1; |