Skip to content

Commit

Permalink
drop_monitor: fix trace_napi_poll_hit()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiao Guangrong authored and David S. Miller committed Sep 2, 2009
1 parent 3732e9b commit f2798eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/drop_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f2798eb

Please sign in to comment.