Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
IBV_INIT_CMD_RESP(cmd, cmd_size, GET_CONTEXT, resp, resp_size);
cmd->cq_fd_tab = (uintptr_t) &cq_fd;
- if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
+ if (write(context->cmd_fd, cmd, cmd_size) != cmd_size) {
+ free(t);
return errno;
+ }
VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
l = calloc(n + 2, sizeof (struct ibv_device_1_0 *));
if (!l)
- return NULL;
+ goto free_device_list;
l[0] = (void *) real_list;
for (i = 1; i <= n; ++i)
if (l[i])
free(l[i]);
+ free(l);
+
+free_device_list:
ibv_free_device_list(real_list);
return NULL;
}
if (asprintf(&path, "%s/%s", IBV_CONFIG_DIR, dent->d_name) < 0) {
fprintf(stderr, PFX "Warning: couldn't read config file %s/%s.\n",
IBV_CONFIG_DIR, dent->d_name);
- return;
+ goto out;
}
if (stat(path, &buf)) {
free(path);
}
+out:
closedir(conf_dir);
}