X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_vhost%2Fvhost.c;h=e4150934bebd833ecbc3390a85635c1e1b6467fb;hb=04b2c3c9434686cf4c221bd44fc5d9e75564c35a;hp=d8116ffaa9452066febfa335c598a4103b9a208a;hpb=f689586bc060aeb3f0ba038d34263c6b943ed31a;p=dpdk.git diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index d8116ffaa9..e4150934be 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -227,9 +227,8 @@ reset_device(struct virtio_net *dev) } /* - * Function is called from the CUSE open function. The device structure is - * initialised and a new entry is added to the device configuration linked - * list. + * Invoked when there is a new vhost-user connection established (when + * there is a new virtio device being attached). */ int vhost_new_device(void) @@ -251,6 +250,7 @@ vhost_new_device(void) if (i == MAX_VHOST_DEVICE) { RTE_LOG(ERR, VHOST_CONFIG, "Failed to find a free slot for new device.\n"); + rte_free(dev); return -1; } @@ -261,8 +261,8 @@ vhost_new_device(void) } /* - * Function is called from the CUSE release function. This function will - * cleanup the device and remove it from device configuration linked list. + * Invoked when there is the vhost-user connection is broken (when + * the virtio device is being detached). */ void vhost_destroy_device(int vid)