X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvhost_xen%2Fvhost_monitor.c;h=7cc5c2fbd2273de75b993a9118f40542134f6495;hb=c7985de0a7f0769d6e4e112b18314aceecf2642c;hp=9d99962ce1e647f44fcd60afe00c5e76ccdaa280;hpb=435eb142bbd7c90299ffce2d389395927b1f7692;p=dpdk.git diff --git a/examples/vhost_xen/vhost_monitor.c b/examples/vhost_xen/vhost_monitor.c index 9d99962ce1..7cc5c2fbd2 100644 --- a/examples/vhost_xen/vhost_monitor.c +++ b/examples/vhost_xen/vhost_monitor.c @@ -181,8 +181,8 @@ add_config_ll_entry(struct virtio_net_config_ll *new_ll_dev) ll_root = new_ll_dev; } else { /* increment through the ll until we find un unused device_id, - * insert the device at that entry - */ + * insert the device at that entry + */ while ((ll_dev->next != NULL) && (ll_dev->dev.device_fh == (ll_dev->next->dev.device_fh - 1))) ll_dev = ll_dev->next; @@ -296,12 +296,10 @@ virtio_net_config_ll *new_device(unsigned int virtio_idx, struct xen_guest *gues add_config_ll_entry(new_ll_dev); return new_ll_dev; err: - if (new_ll_dev) - free(new_ll_dev); - if (virtqueue_rx) - rte_free(virtqueue_rx); - if (virtqueue_tx) - rte_free(virtqueue_tx); + free(new_ll_dev); + rte_free(virtqueue_rx); + rte_free(virtqueue_tx); + return NULL; } @@ -591,5 +589,3 @@ init_virtio_xen(struct virtio_net_device_ops const *const ops) return -1; return 0; } - -