bridge: Fix use of wild pointer in iface_do_create().
authorBen Pfaff <blp@nicira.com>
Fri, 17 May 2013 05:37:53 +0000 (22:37 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 17 May 2013 05:49:21 +0000 (22:49 -0700)
'netdev' was not initialized at this point in the function, so the cleanup
at the error label referenced a wild pointer.

Introduced in commit 94a538422d4b (netdev: Prevent using reserved names).

CC: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
vswitchd/bridge.c

index 28e306e..e10036c 100644 (file)
@@ -1415,7 +1415,7 @@ iface_do_create(const struct bridge *br,
 {
     const struct ovsrec_interface *iface_cfg = if_cfg->cfg;
     const struct ovsrec_port *port_cfg = if_cfg->parent;
-    struct netdev *netdev;
+    struct netdev *netdev = NULL;
     int error;
 
     if (netdev_is_reserved_name(iface_cfg->name)) {