Skip to content

Commit

Permalink
ksmbd: fix uninitialized symbol 'share' in smb2_tree_connect()
Browse files Browse the repository at this point in the history
Fix uninitialized symbol 'share' in smb2_tree_connect().

Fixes: e9d8c2f95ab8 ("ksmbd: add continuous availability share parameter")
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
namjaejeon committed Apr 27, 2024
1 parent 83d1372 commit f878f24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,7 @@ int smb2_tree_connect(struct ksmbd_work *work)
struct ksmbd_session *sess = work->sess;
char *treename = NULL, *name = NULL;
struct ksmbd_tree_conn_status status;
struct ksmbd_share_config *share;
struct ksmbd_share_config *share = NULL;
int rc = -EINVAL;

WORK_BUFFERS(work, req, rsp);
Expand Down Expand Up @@ -2006,7 +2006,7 @@ int smb2_tree_connect(struct ksmbd_work *work)
write_unlock(&sess->tree_conns_lock);
rsp->StructureSize = cpu_to_le16(16);
out_err1:
if (server_conf.flags & KSMBD_GLOBAL_FLAG_DURABLE_HANDLE &&
if (server_conf.flags & KSMBD_GLOBAL_FLAG_DURABLE_HANDLE && share &&
test_share_config_flag(share,
KSMBD_SHARE_FLAG_CONTINUOUS_AVAILABILITY))
rsp->Capabilities = SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY;
Expand Down

0 comments on commit f878f24

Please sign in to comment.