Avoid wild pointer write in del_switch_port().
authorBen Pfaff <blp@nicira.com>
Mon, 2 Jun 2008 17:13:23 +0000 (10:13 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 3 Jun 2008 03:18:38 +0000 (20:18 -0700)
datapath/datapath.c

index 4b7064998e6781c56e24a5fffcb32c84c192faf6..c87fa241634e39f70108aa2195627949e4ac140a 100644 (file)
@@ -387,7 +387,8 @@ static int del_switch_port(struct net_bridge_port *p)
        dev_set_promiscuity(p->dev, -1);
        rtnl_unlock();
        list_del_rcu(&p->node);
-       rcu_assign_pointer(p->dp->ports[p->port_no], NULL);
+       if (p->port_no != OFPP_LOCAL)
+               rcu_assign_pointer(p->dp->ports[p->port_no], NULL);
        rcu_assign_pointer(p->dev->br_port, NULL);
 
        /* Then wait until no one is still using it, and destroy it. */