浏览代码

if_vlan: Call dev_kfree_skb_any instead of kfree_skb.

Replace kfree_skb with dev_kfree_skb_any in vlan_insert_tag as
vlan_insert_tag can be called from hard irq context (netpoll)
and from other contexts.

dev_kfree_skb_any is used as vlan_insert_tag only frees the skb if the
skb can not be modified to insert a tag, in which case vlan_insert_tag
drops the skb.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Eric W. Biederman 11 年之前
父节点
当前提交
fb7c03dfc4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/linux/if_vlan.h

+ 1 - 1
include/linux/if_vlan.h

@@ -288,7 +288,7 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb,
 	struct vlan_ethhdr *veth;
 	struct vlan_ethhdr *veth;
 
 
 	if (skb_cow_head(skb, VLAN_HLEN) < 0) {
 	if (skb_cow_head(skb, VLAN_HLEN) < 0) {
-		kfree_skb(skb);
+		dev_kfree_skb_any(skb);
 		return NULL;
 		return NULL;
 	}
 	}
 	veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
 	veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);