mwifiex: move if_ops.cleanup_if() call
authorAmitkumar Karwar <akarwar@marvell.com>
Tue, 23 Jul 2013 02:17:50 +0000 (19:17 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 24 Jul 2013 15:02:09 +0000 (11:02 -0400)
As if_ops.init_if() is called in mwifiex_register(),
corresponding cleanup routine should be called in
mwifiex_unregister().

Currently it's there in mwifiex_adapter_cleanup(), hence
interface specific cleanup is not performed if driver
initialization is failed.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/init.c
drivers/net/wireless/mwifiex/main.c

index 2a430c9cbd0e9968c2b211d85b46eee98ded9db6..2ef450e99c7599dbdf90f4d4801b7a25d9695b0a 100644 (file)
@@ -394,9 +394,6 @@ mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter)
 
        dev_dbg(adapter->dev, "info: free scan table\n");
 
-       if (adapter->if_ops.cleanup_if)
-               adapter->if_ops.cleanup_if(adapter);
-
        if (adapter->sleep_cfm)
                dev_kfree_skb_any(adapter->sleep_cfm);
 }
index ef151c58ac1411d6e256a35cae3d59c21d67d5bc..f26beb7ed022224b3a2ba4c5496a527aef2ed4b8 100644 (file)
@@ -191,6 +191,9 @@ static int mwifiex_unregister(struct mwifiex_adapter *adapter)
 {
        s32 i;
 
+       if (adapter->if_ops.cleanup_if)
+               adapter->if_ops.cleanup_if(adapter);
+
        del_timer(&adapter->cmd_timer);
 
        /* Free private structures */