aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2012-01-17 05:00:40 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-17 15:51:23 -0500
commit65e9d2faab70d07b9a38ac6ed298f191d24541fc (patch)
tree41bb55a55858d79f142cb37c2f3c3364fc778790 /net
parent36c92474498ad6cc3afb24b91a67a444d79978fe (diff)
net: fix NULL-deref in WARN() in skb_gso_segment()
Bug was introduced in commit c8f44affb7244f2ac3e703cab13d55ede27621bb. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 17db2f2e5236..115dee1d985d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1889,6 +1889,7 @@ EXPORT_SYMBOL(skb_set_dev);
1889 1889
1890static void skb_warn_bad_offload(const struct sk_buff *skb) 1890static void skb_warn_bad_offload(const struct sk_buff *skb)
1891{ 1891{
1892 static const netdev_features_t null_features = 0;
1892 struct net_device *dev = skb->dev; 1893 struct net_device *dev = skb->dev;
1893 const char *driver = ""; 1894 const char *driver = "";
1894 1895
@@ -1897,8 +1898,8 @@ static void skb_warn_bad_offload(const struct sk_buff *skb)
1897 1898
1898 WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d gso_size=%d " 1899 WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d gso_size=%d "
1899 "gso_type=%d ip_summed=%d\n", 1900 "gso_type=%d ip_summed=%d\n",
1900 driver, dev ? &dev->features : NULL, 1901 driver, dev ? &dev->features : &null_features,
1901 skb->sk ? &skb->sk->sk_route_caps : NULL, 1902 skb->sk ? &skb->sk->sk_route_caps : &null_features,
1902 skb->len, skb->data_len, skb_shinfo(skb)->gso_size, 1903 skb->len, skb->data_len, skb_shinfo(skb)->gso_size,
1903 skb_shinfo(skb)->gso_type, skb->ip_summed); 1904 skb_shinfo(skb)->gso_type, skb->ip_summed);
1904} 1905}