iwlwifi: mvm: move TX PN assignment for CCMP to the driver
[firefly-linux-kernel-4.4.55.git] / drivers / net / macvtap.c
index 483afb19596ce04bf931ccf2e97aa476fa738082..6a64197f5bcef6fa4fce9e714bee6fa664e46fb7 100644 (file)
@@ -263,27 +263,21 @@ out:
 static void macvtap_del_queues(struct net_device *dev)
 {
        struct macvlan_dev *vlan = netdev_priv(dev);
-       struct macvtap_queue *q, *tmp, *qlist[MAX_MACVTAP_QUEUES];
-       int i, j = 0;
+       struct macvtap_queue *q, *tmp;
 
        ASSERT_RTNL();
        list_for_each_entry_safe(q, tmp, &vlan->queue_list, next) {
                list_del_init(&q->next);
-               qlist[j++] = q;
                RCU_INIT_POINTER(q->vlan, NULL);
                if (q->enabled)
                        vlan->numvtaps--;
                vlan->numqueues--;
+               sock_put(&q->sk);
        }
-       for (i = 0; i < vlan->numvtaps; i++)
-               RCU_INIT_POINTER(vlan->taps[i], NULL);
        BUG_ON(vlan->numvtaps);
        BUG_ON(vlan->numqueues);
        /* guarantee that any future macvtap_set_queue will fail */
        vlan->numvtaps = MAX_MACVTAP_QUEUES;
-
-       for (--j; j >= 0; j--)
-               sock_put(&qlist[j]->sk);
 }
 
 static rx_handler_result_t macvtap_handle_frame(struct sk_buff **pskb)