Skip to content

Commit

Permalink
STACK: PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-shalev committed Oct 10, 2024
1 parent 46c3695 commit 9f41e2d
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 18 deletions.
8 changes: 3 additions & 5 deletions src/tools/vfs/vfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,15 @@ int vfs_mount(int pid)

/* Mount a new FUSE filesystem in the mount point directory */
vfs_log("mounting directory '%s' with options '%s'", mountpoint, mountopts);
fuse_fd = fuse_open_channel(mountpoint, mountopts);
if (fuse_fd < 0) {
ret = fuse_fd;
ret = fuse_open_channel(mountpoint, mountopts);
if (ret < 0) {
vfs_error("fuse_open_channel(%s,opts=%s) failed: %m", mountpoint,
mountopts);
goto out_free_mountpoint;
}

fuse_fd = ret;
vfs_log("mounted directory '%s' with fd %d", mountpoint, fuse_fd);
ret = fuse_fd;

out_free_mountpoint:
ucs_free(mountpoint);
Expand Down Expand Up @@ -239,7 +238,6 @@ int vfs_unmount(int pid)
ret = rmdir(mountpoint);
if (ret < 0) {
vfs_error("failed to remove directory '%s': %m", mountpoint);
goto out_free_mountpoint;
}

out_free_mountpoint:
Expand Down
5 changes: 1 addition & 4 deletions src/ucs/config/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,7 @@ void ucs_config_parse_config_files()

status = ucs_string_alloc_path_buffer(&path, "path");
if (status != UCS_OK) {
goto out;
return;
}

/* System-wide configuration file */
Expand Down Expand Up @@ -1796,10 +1796,7 @@ void ucs_config_parse_config_files()
/* Current working dir */
ucs_config_parse_config_file(".", UCX_CONFIG_FILE_NAME, 1);

out_free_path:
ucs_free(path);
out:
return;
}

ucs_status_t
Expand Down
1 change: 0 additions & 1 deletion src/ucs/debug/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ static void ucs_log_file_rotate()
}
}

out_free_new_log_file_name:
ucs_free(new_log_file_name);
out_free_old_log_file_name:
ucs_free(old_log_file_name);
Expand Down
2 changes: 1 addition & 1 deletion src/ucs/sys/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ unsigned ucs_netif_bond_ad_num_ports(const char *bond_name)
status = ucs_string_alloc_path_buffer(&lowest_path_buf, "lowest_path_buf");
if (status != UCS_OK) {
ret = 1;
goto out_free_lowest_path_buf;
goto out;
}

status = ucs_netif_get_lowest_device_path(bond_name, lowest_path_buf,
Expand Down
3 changes: 1 addition & 2 deletions src/ucs/vfs/base/vfs_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ static ucs_status_t ucs_vfs_node_add(void *parent_obj, ucs_vfs_node_type_t type,
token = strsep(&next_token, "/");
}

ucs_vfs_node_build_path(current_node, token, abs_path_buf,
PATH_MAX);
ucs_vfs_node_build_path(current_node, token, abs_path_buf, PATH_MAX);

if (ucs_vfs_node_need_update_path(type, abs_path_buf, obj)) {
ucs_vfs_node_update_path(obj, abs_path_buf, PATH_MAX);
Expand Down
1 change: 0 additions & 1 deletion src/ucs/vfs/fuse/vfs_fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ static ucs_status_t ucs_vfs_fuse_wait_for_path(const char *path)
ucs_vfs_fuse_context.inotify_fd = -1;
out_unlock:
pthread_mutex_unlock(&ucs_vfs_fuse_context.mutex);
out_free_dir_buf:
ucs_free(dir_buf);
out:
return status;
Expand Down
2 changes: 0 additions & 2 deletions src/ucs/vfs/sock/vfs_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ int ucs_vfs_sock_mkdir(const char *sock_path, ucs_log_level_t log_level)
ucs_log(log_level, "failed to create directory '%s': %m",
sock_path_dir);
ret = -errno;
goto out_free_sock_path_dir;
}

out_free_sock_path_dir:
ucs_free(sock_path_dir);
out:
return ret;
Expand Down
1 change: 0 additions & 1 deletion src/uct/sm/mm/posix/mm_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ static ucs_status_t uct_posix_file_open(const char *dir, uint64_t mmid,
ret = open(file_path, open_flags | O_RDWR, UCT_POSIX_SHM_OPEN_MODE);
status = uct_posix_open_check_result("open", file_path, open_flags, ret, fd_p);

out_free_file_path:
ucs_free(file_path);
out:
return status;
Expand Down
1 change: 0 additions & 1 deletion src/uct/tcp/tcp_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,6 @@ static int uct_tcp_is_bridge(const char *if_name)

ret = (stat(path, &st) == 0) && S_ISDIR(st.st_mode);

out_free_path:
ucs_free(path);
out:
return ret;
Expand Down

0 comments on commit 9f41e2d

Please sign in to comment.