examples/ip_pipeline: move config files to separate directory
[dpdk.git] / examples / vm_power_manager / channel_manager.c
index 7828be7..7d892e2 100644 (file)
@@ -389,7 +389,7 @@ add_all_channels(const char *vm_name)
                errno = 0;
                channel_num = (unsigned)strtol(remaining, &tail_ptr, 0);
                if ((errno != 0) || (remaining[0] == '\0') ||
-                               (*tail_ptr != '\0') || tail_ptr == NULL) {
+                               tail_ptr == NULL || (*tail_ptr != '\0')) {
                        RTE_LOG(WARNING, CHANNEL_MANAGER, "Malformed channel name"
                                        "'%s' found it should be in the form of "
                                        "'<guest_name>.<channel_num>(decimal)'\n",
@@ -597,7 +597,7 @@ get_info_vm(const char *vm_name, struct vm_info *info)
        ITERATIVE_BITMASK_CHECK_64(mask, i) {
                info->channels[channel_num].channel_num = i;
                memcpy(info->channels[channel_num].channel_path,
-                               vm_info->channels[i]->channel_path, PATH_MAX);
+                               vm_info->channels[i]->channel_path, UNIX_PATH_MAX);
                info->channels[channel_num].status = vm_info->channels[i]->status;
                info->channels[channel_num].fd = vm_info->channels[i]->fd;
                channel_num++;
@@ -800,9 +800,7 @@ channel_manager_exit(void)
                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();
 }