drop_monitor: fix trace_napi_poll_hit()
Xiao Guangrong [Sun, 30 Aug 2009 20:10:43 +0000 (20:10 +0000)]
The net_dev of backlog napi is NULL, like below:

__get_cpu_var(softnet_data).backlog.dev == NULL

So, we should check it in napi tracepoint's probe function

Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

net/core/drop_monitor.c

index 9d66fa9..d311202 100644 (file)
@@ -182,7 +182,8 @@ static void trace_napi_poll_hit(struct napi_struct *napi)
        /*
         * Ratelimit our check time to dm_hw_check_delta jiffies
         */
-       if (!time_after(jiffies, napi->dev->last_rx + dm_hw_check_delta))
+       if (!napi->dev ||
+           !time_after(jiffies, napi->dev->last_rx + dm_hw_check_delta))
                return;
 
        rcu_read_lock();