From: Paolo Abeni Date: Thu, 8 Mar 2018 09:29:30 +0000 (+0100) Subject: ipvlan: properly annotate rx_handler access X-Git-Tag: android-x86-8.1-r1~1393^2~255 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ae5799dc7ec77fe0382d58cdcba9f6d1204157ae;p=android-x86%2Fkernel.git ipvlan: properly annotate rx_handler access The rx_handler field is rcu-protected, but I forgot to use the proper accessor while refactoring netif_is_ipvlan_port(). Such function only check the rx_handler value, so it is safe, but we need to properly read rx_handler via rcu_access_pointer() to avoid sparse warnings. Fixes: 1ec54cb44e67 ("net: unpollute priv_flags space") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller --- diff --git a/drivers/net/ipvlan/ipvlan.h b/drivers/net/ipvlan/ipvlan.h index c818b9bdab6e..adb826f55e60 100644 --- a/drivers/net/ipvlan/ipvlan.h +++ b/drivers/net/ipvlan/ipvlan.h @@ -180,7 +180,7 @@ int ipvlan_link_register(struct rtnl_link_ops *ops); static inline bool netif_is_ipvlan_port(const struct net_device *dev) { - return dev->rx_handler == ipvlan_handle_frame; + return rcu_access_pointer(dev->rx_handler) == ipvlan_handle_frame; } #endif /* __IPVLAN_H */