From 65e9d2faab70d07b9a38ac6ed298f191d24541fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Date: Tue, 17 Jan 2012 10:00:40 +0000 Subject: net: fix NULL-deref in WARN() in skb_gso_segment() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug was introduced in commit c8f44affb7244f2ac3e703cab13d55ede27621bb. Signed-off-by: Michał Mirosław Signed-off-by: David S. Miller --- net/core/dev.c | 5 +++-- 1 file 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); static void skb_warn_bad_offload(const struct sk_buff *skb) { + static const netdev_features_t null_features = 0; struct net_device *dev = skb->dev; const char *driver = ""; @@ -1897,8 +1898,8 @@ static void skb_warn_bad_offload(const struct sk_buff *skb) WARN(1, "%s: caps=(%pNF, %pNF) len=%d data_len=%d gso_size=%d " "gso_type=%d ip_summed=%d\n", - driver, dev ? &dev->features : NULL, - skb->sk ? &skb->sk->sk_route_caps : NULL, + driver, dev ? &dev->features : &null_features, + skb->sk ? &skb->sk->sk_route_caps : &null_features, skb->len, skb->data_len, skb_shinfo(skb)->gso_size, skb_shinfo(skb)->gso_type, skb->ip_summed); } -- cgit v1.2.1