From: Jesse Gross Date: Tue, 31 Jan 2012 22:22:25 +0000 (-0800) Subject: datapath: Don't dereference potentially NULL vport in patch ports. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c240693fc4d23786ab74bebfde45b44efc8ed39b;p=openvswitch datapath: Don't dereference potentially NULL vport in patch ports. When changing patch ports we need to update any peers pointing to us. When destroying the port, this means pointing them to a NULL port. However, the new namespaces code attempted to dereference this port in order to get the namespace. The net is already passed in, so we can just use that instead. Bug #9477 Reported-by: Michael Hu Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/vport-patch.c b/datapath/vport-patch.c index 0056792b..ea46a8dc 100644 --- a/datapath/vport-patch.c +++ b/datapath/vport-patch.c @@ -233,7 +233,7 @@ error: static void update_peers(struct net *net, const char *name, struct vport *vport) { - struct hlist_head *bucket = hash_bucket(ovs_dp_get_net(vport->dp), name); + struct hlist_head *bucket = hash_bucket(net, name); struct patch_vport *peer_vport; struct hlist_node *node;