staging: most: net: remove redundant cleanup code
authorAndrey Shvetsov <andrey.shvetsov@k2l.de>
Fri, 12 May 2017 10:59:56 +0000 (12:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2017 09:59:10 +0000 (11:59 +0200)
This removes redundant cleanup code that is executed anyway when the
most_deregister_aim() is called.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/aim-network/networking.c

index 11f03d3..e2935cc 100644 (file)
@@ -509,25 +509,8 @@ static int __init most_net_init(void)
 
 static void __exit most_net_exit(void)
 {
-       struct net_dev_context *nd, *tmp;
-       unsigned long flags;
-
-       spin_lock_irqsave(&list_lock, flags);
-       list_for_each_entry_safe(nd, tmp, &net_devices, list) {
-               list_del(&nd->list);
-               spin_unlock_irqrestore(&list_lock, flags);
-               /*
-                * do not call most_stop_channel() here, because channels are
-                * going to be closed in ndo_stop() after unregister_netdev()
-                */
-               most_net_rm_netdev_safe(nd);
-               kfree(nd);
-               spin_lock_irqsave(&list_lock, flags);
-       }
-       spin_unlock_irqrestore(&list_lock, flags);
-
-       most_deregister_aim(&aim);
        pr_info("most_net_exit()\n");
+       most_deregister_aim(&aim);
 }
 
 /**