[NET]: Fix NULL pointer deref in checksum debugging.
authorStephen Hemminger <shemminger@osdl.org>
Thu, 8 Dec 2005 23:21:39 +0000 (15:21 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Dec 2005 23:21:39 +0000 (15:21 -0800)
The problem I was seeing turned out to be that skb->dev is NULL when
the checksum is being completed in user context. This happens because
the reference to the device is dropped (to allow it to be released
when packets are in the queue).

Because skb->dev was NULL, the netdev_rx_csum_fault was panicing on
deref of dev->name. How about this?

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index 0b48e294aafec9e7f8c0f7d43212164652afabf6..a5efc9ae010bb144260258c51ae7556447c5c421 100644 (file)
@@ -1113,7 +1113,8 @@ out:
 void netdev_rx_csum_fault(struct net_device *dev)
 {
        if (net_ratelimit()) {
-               printk(KERN_ERR "%s: hw csum failure.\n", dev->name);
+               printk(KERN_ERR "%s: hw csum failure.\n", 
+                       dev ? dev->name : "<unknown>");
                dump_stack();
        }
 }