datapath: Take a rcu_dereference() in netdev_get_vport()
authorSimon Horman <horms@verge.net.au>
Mon, 23 Aug 2010 06:30:09 +0000 (15:30 +0900)
committerJesse Gross <jesse@nicira.com>
Mon, 23 Aug 2010 18:37:44 +0000 (14:37 -0400)
Although not strictly necessary, this will make this
function more consistent when compatibility for 2.6.36 is added.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/vport-netdev.c

index 39e963e019a2f77e5a35336971002784b8a08a66..e60453544e70e03856eb127ca426efd18aa56ee8 100644 (file)
@@ -304,7 +304,7 @@ static int netdev_send(struct vport *vport, struct sk_buff *skb)
 /* Returns null if this device is not attached to a datapath. */
 struct vport *netdev_get_vport(struct net_device *dev)
 {
-       return (struct vport *)dev->br_port;
+       return (struct vport *)rcu_dereference(dev->br_port);
 }
 
 struct vport_ops netdev_vport_ops = {