aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 84f01ba81a34..1cb0d8a6aa6c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2444,8 +2444,12 @@ static void skb_update_prio(struct sk_buff *skb)
2444{ 2444{
2445 struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap); 2445 struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap);
2446 2446
2447 if ((!skb->priority) && (skb->sk) && map) 2447 if (!skb->priority && skb->sk && map) {
2448 skb->priority = map->priomap[skb->sk->sk_cgrp_prioidx]; 2448 unsigned int prioidx = skb->sk->sk_cgrp_prioidx;
2449
2450 if (prioidx < map->priomap_len)
2451 skb->priority = map->priomap[prioidx];
2452 }
2449} 2453}
2450#else 2454#else
2451#define skb_update_prio(skb) 2455#define skb_update_prio(skb)
@@ -6279,7 +6283,8 @@ static struct hlist_head *netdev_create_hash(void)
6279/* Initialize per network namespace state */ 6283/* Initialize per network namespace state */
6280static int __net_init netdev_init(struct net *net) 6284static int __net_init netdev_init(struct net *net)
6281{ 6285{
6282 INIT_LIST_HEAD(&net->dev_base_head); 6286 if (net != &init_net)
6287 INIT_LIST_HEAD(&net->dev_base_head);
6283 6288
6284 net->dev_name_head = netdev_create_hash(); 6289 net->dev_name_head = netdev_create_hash();
6285 if (net->dev_name_head == NULL) 6290 if (net->dev_name_head == NULL)