rte_free handles getting passed a NULL pointer.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
RTE_LOG(INFO, VHOST_DATA, "(%"PRIu64") Failed to add device to data core\n", dev->device_fh);
vdev->ready = DEVICE_SAFE_REMOVE;
destroy_device(dev);
- if (vdev->regions_hpa)
- rte_free(vdev->regions_hpa);
+ rte_free(vdev->regions_hpa);
rte_free(vdev);
return -1;
}
err:
if (new_ll_dev)
free(new_ll_dev);
- if (virtqueue_rx)
- rte_free(virtqueue_rx);
- if (virtqueue_tx)
- rte_free(virtqueue_tx);
+ rte_free(virtqueue_rx);
+ rte_free(virtqueue_tx);
+
return NULL;
}
rte_free(vm_info);
}
- if (global_cpumaps != NULL)
- rte_free(global_cpumaps);
- if (global_vircpuinfo != NULL)
- rte_free(global_vircpuinfo);
+ rte_free(global_cpumaps);
+ rte_free(global_vircpuinfo);
disconnect_hypervisor();
}