kernel: allow __netdev_alloc_skb_ip_align to be called with dev = NULL
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 22 Apr 2013 15:01:36 +0000 (15:01 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 22 Apr 2013 15:01:36 +0000 (15:01 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36378 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/generic/patches-3.3/721-phy_packets.patch
target/linux/generic/patches-3.6/721-phy_packets.patch
target/linux/generic/patches-3.7/721-phy_packets.patch
target/linux/generic/patches-3.8/721-phy_packets.patch
target/linux/generic/patches-3.9/721-phy_packets.patch

index 575fbae..cdb01be 100644 (file)
 +      struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
 +
 +#ifdef CONFIG_ETHERNET_PACKET_MANGLE
-+      if (dev->priv_flags & IFF_NO_IP_ALIGN)
++      if (dev && (dev->priv_flags & IFF_NO_IP_ALIGN))
 +              return skb;
 +#endif
 +
index 3a0fdc9..70b65a8 100644 (file)
 +      struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
 +
 +#ifdef CONFIG_ETHERNET_PACKET_MANGLE
-+      if (dev->priv_flags & IFF_NO_IP_ALIGN)
++      if (dev && (dev->priv_flags & IFF_NO_IP_ALIGN))
 +              return skb;
 +#endif
 +
index b8c15fc..78b2d69 100644 (file)
 +      struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
 +
 +#ifdef CONFIG_ETHERNET_PACKET_MANGLE
-+      if (dev->priv_flags & IFF_NO_IP_ALIGN)
++      if (dev && (dev->priv_flags & IFF_NO_IP_ALIGN))
 +              return skb;
 +#endif
 +
index d78ba8e..88b5969 100644 (file)
 +      struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
 +
 +#ifdef CONFIG_ETHERNET_PACKET_MANGLE
-+      if (dev->priv_flags & IFF_NO_IP_ALIGN)
++      if (dev && (dev->priv_flags & IFF_NO_IP_ALIGN))
 +              return skb;
 +#endif
 +
index 65f5ffd..dbf105e 100644 (file)
 +      struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
 +
 +#ifdef CONFIG_ETHERNET_PACKET_MANGLE
-+      if (dev->priv_flags & IFF_NO_IP_ALIGN)
++      if (dev && (dev->priv_flags & IFF_NO_IP_ALIGN))
 +              return skb;
 +#endif
 +