kernel: allow __netdev_alloc_skb_ip_align to be called with dev = NULL
[openwrt.git] / target / linux / generic / patches-3.7 / 721-phy_packets.patch
index 8dda0934b53f502053db7875ec522a7c7bbe5fa2..78b2d69b474a2e25b551b100783a435db4b9d4f1 100644 (file)
@@ -1,6 +1,6 @@
 --- a/include/linux/netdevice.h
 +++ b/include/linux/netdevice.h
-@@ -1074,6 +1074,11 @@ struct net_device {
+@@ -1077,6 +1077,11 @@ struct net_device {
        const struct net_device_ops *netdev_ops;
        const struct ethtool_ops *ethtool_ops;
  
@@ -12,7 +12,7 @@
        /* Hardware header description */
        const struct header_ops *header_ops;
  
-@@ -1130,6 +1135,9 @@ struct net_device {
+@@ -1133,6 +1138,9 @@ struct net_device {
        void                    *ax25_ptr;      /* AX.25 specific data */
        struct wireless_dev     *ieee80211_ptr; /* IEEE 802.11 specific data,
                                                   assign before registering */
 +      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
 +