From fa33d64a5797e59d61fd3d12257b27b5565fc587 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 3 Dec 2009 15:14:56 -0800 Subject: [PATCH] vswitchd: Avoid segfault when creating a bridge fails. bridge_create() can return a null pointer if creating the bridge fails, so check for that and don't dereference it in that case. Thank to Jeremy Stribling for reporting the problem. --- vswitchd/bridge.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 3028766c..581af96a 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -562,7 +562,9 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg) const struct ovsrec_bridge *br_cfg = node->data; if (!shash_find_data(&old_br, br_name)) { br = bridge_create(br_name); - br->cfg = br_cfg; + if (br) { + br->cfg = br_cfg; + } } } shash_destroy(&old_br); -- 2.30.2