[ovs-dev] [PATCH 1/3] bridge: Fix a NULL dereference

YAMAMOTO Takashi yamamoto at valinux.co.jp
Fri May 2 23:09:59 UTC 2014


Introduced by commit 12eb035b.
("bridge: Allow users to configure statistics update to OVSDB.")

Cc: Alex Wang <alexw at nicira.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
---
 vswitchd/bridge.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 1145e98..43c109c 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2383,8 +2383,13 @@ bridge_run(void)
 
     /* Statistics update interval should always be greater than or equal to
      * 5000 ms. */
-    stats_interval = MAX(smap_get_int(&cfg->other_config,
-                                      "stats-update-interval", 5000), 5000);
+    if (cfg) {
+        stats_interval = MAX(smap_get_int(&cfg->other_config,
+                                          "stats-update-interval",
+                                          5000), 5000);
+    } else {
+        stats_interval = 5000;
+    }
     if (stats_timer_interval != stats_interval) {
         stats_timer_interval = stats_interval;
         stats_timer = LLONG_MIN;
-- 
1.8.3.1




More information about the dev mailing list