Skip to content

Commit

Permalink
Merge tag '5.11-rc3-smb3' of git://git.samba.org/sfrench/cifs-2.6
Browse files Browse the repository at this point in the history
Pull cifs fixes from Steve French:
 "Two small cifs fixes for stable (including an important handle leak
  fix) and three small cleanup patches"

* tag '5.11-rc3-smb3' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: style: replace one-element array with flexible-array
  cifs: connect: style: Simplify bool comparison
  fs: cifs: remove unneeded variable in smb3_fs_context_dup
  cifs: fix interrupted close commands
  cifs: check pointer before freeing
  • Loading branch information
torvalds committed Jan 15, 2021
2 parents 82821be + e54fd07 commit 7cd3c41
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3740,7 +3740,7 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,

if (!ses->binding) {
ses->capabilities = server->capabilities;
if (linuxExtEnabled == 0)
if (!linuxExtEnabled)
ses->capabilities &= (~server->vals->cap_unix);

if (ses->auth_key.response) {
Expand Down
3 changes: 2 additions & 1 deletion fs/cifs/dfs_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,8 @@ void dfs_cache_del_vol(const char *fullpath)
vi = find_vol(fullpath);
spin_unlock(&vol_list_lock);

kref_put(&vi->refcnt, vol_release);
if (!IS_ERR(vi))
kref_put(&vi->refcnt, vol_release);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions fs/cifs/fs_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,6 @@ do { \
int
smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx)
{
int rc = 0;

memcpy(new_ctx, ctx, sizeof(*ctx));
new_ctx->prepath = NULL;
new_ctx->mount_options = NULL;
Expand All @@ -327,7 +325,7 @@ smb3_fs_context_dup(struct smb3_fs_context *new_ctx, struct smb3_fs_context *ctx
DUP_CTX_STR(nodename);
DUP_CTX_STR(iocharset);

return rc;
return 0;
}

static int
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3248,7 +3248,7 @@ __SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
free_rsp_buf(resp_buftype, rsp);

/* retry close in a worker thread if this one is interrupted */
if (rc == -EINTR) {
if (is_interrupt_error(rc)) {
int tmp_rc;

tmp_rc = smb2_handle_cancelled_close(tcon, persistent_fid,
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/smb2pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ struct smb2_rdma_transform_capabilities_context {
__le16 TransformCount;
__u16 Reserved1;
__u32 Reserved2;
__le16 RDMATransformIds[1];
__le16 RDMATransformIds[];
} __packed;

/* Signing algorithms */
Expand Down

0 comments on commit 7cd3c41

Please sign in to comment.