From: Ben Pfaff Date: Mon, 2 Jun 2008 17:18:00 +0000 (-0700) Subject: Don't oops on deldp, by avoiding use-after-free on net_bridge_port. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc51dcfff9892478b026aeb234115146d7301b59;p=openvswitch Don't oops on deldp, by avoiding use-after-free on net_bridge_port. --- diff --git a/datapath/datapath.c b/datapath/datapath.c index adc69806..ed9c557c 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -406,12 +406,12 @@ static int del_switch_port(struct net_bridge_port *p) /* Called with dp_mutex. */ static void del_dp(struct datapath *dp) { - struct net_bridge_port *p; + struct net_bridge_port *p, *n; kthread_stop(dp->dp_task); /* Drop references to DP. */ - list_for_each_entry_rcu (p, &dp->port_list, node) + list_for_each_entry_safe (p, n, &dp->port_list, node) del_switch_port(p); rcu_assign_pointer(dps[dp->dp_idx], NULL);