RTE_LOG(DEBUG, EAL, "request: %s\n", req->name);
- if (check_input(req) == false)
- return -1;
-
reply->nb_sent = 0;
reply->nb_received = 0;
reply->msgs = NULL;
+ if (check_input(req) == false)
+ goto err;
+
if (internal_config.no_shconf) {
RTE_LOG(DEBUG, EAL, "No shared files mode enabled, IPC is disabled\n");
return 0;
if (gettimeofday(&now, NULL) < 0) {
RTE_LOG(ERR, EAL, "Failed to get current time\n");
rte_errno = errno;
- return -1;
+ goto err;
}
end.tv_nsec = (now.tv_usec * 1000 + ts->tv_nsec) % 1000000000;
pthread_mutex_lock(&pending_requests.lock);
ret = mp_request_sync(eal_mp_socket_path(), req, reply, &end);
pthread_mutex_unlock(&pending_requests.lock);
+ if (ret)
+ goto err;
return ret;
}
if (!mp_dir) {
RTE_LOG(ERR, EAL, "Unable to open directory %s\n", mp_dir_path);
rte_errno = errno;
- return -1;
+ goto err;
}
dir_fd = dirfd(mp_dir);
mp_dir_path);
closedir(mp_dir);
rte_errno = errno;
- return -1;
+ goto err;
}
pthread_mutex_lock(&pending_requests.lock);
* locks on receive
*/
if (mp_request_sync(path, req, reply, &end))
- ret = -1;
+ goto err;
}
pthread_mutex_unlock(&pending_requests.lock);
/* unlock the directory */
/* dir_fd automatically closed on closedir */
closedir(mp_dir);
return ret;
+
+err:
+ free(reply->msgs);
+ reply->nb_received = 0;
+ reply->msgs = NULL;
+ return -1;
}
int __rte_experimental