Skip to content

Commit

Permalink
ipvlan: properly annotate rx_handler access
Browse files Browse the repository at this point in the history
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: 1ec54cb ("net: unpollute priv_flags space")
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Paolo Abeni authored and davem330 committed Mar 8, 2018
1 parent a366e30 commit ae5799d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ipvlan/ipvlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit ae5799d

Please sign in to comment.