From e621a12d908695881a54834e70ead71d6d99639b Mon Sep 17 00:00:00 2001
From: Ethan Jackson <ethan@nicira.com>
Date: Mon, 22 Jul 2013 12:54:09 -0700
Subject: [PATCH] ofproto-dpif-xlate: Fix invalid memory read on port removal.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
---
 ofproto/ofproto-dpif-xlate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index eb4ed6957..e5556036b 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -400,7 +400,10 @@ xlate_ofport_remove(struct ofport_dpif *ofport)
         xport->peer = NULL;
     }
 
-    list_remove(&xport->bundle_node);
+    if (xport->xbundle) {
+        list_remove(&xport->bundle_node);
+    }
+
     hmap_remove(&xports, &xport->hmap_node);
     hmap_remove(&xport->xbridge->xports, &xport->ofp_node);
 
-- 
2.47.0