netdev-dpdk: Fix leak on netdev_dpdk_vhost_user_construct failure.
authorIlya Maximets <i.maximets@samsung.com>
Tue, 2 Feb 2016 11:02:16 +0000 (14:02 +0300)
committerBen Pfaff <blp@ovn.org>
Tue, 2 Feb 2016 18:41:09 +0000 (10:41 -0800)
Memory pool for vhost-user ports always created even if construction
fails. And message about successfull socket creation also printed.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/netdev-dpdk.c

index 1e43dae..d115de2 100644 (file)
@@ -690,10 +690,11 @@ netdev_dpdk_vhost_user_construct(struct netdev *netdev_)
                  netdev->vhost_id);
     } else {
         fatal_signal_add_file_to_unlink(netdev->vhost_id);
+        VLOG_INFO("Socket %s created for vhost-user port %s\n",
+                  netdev->vhost_id, netdev_->name);
+        err = vhost_construct_helper(netdev_);
     }
 
-    VLOG_INFO("Socket %s created for vhost-user port %s\n", netdev->vhost_id, netdev_->name);
-    err = vhost_construct_helper(netdev_);
     ovs_mutex_unlock(&dpdk_mutex);
     return err;
 }