Skip to content
/ linux Public

Commit 7c9ce68

Browse files
sprasad-microsoftSasha Levin
authored andcommitted
cifs: some missing initializations on replay
[ Upstream commit 14f66f4 ] In several places in the code, we have a label to signify the start of the code where a request can be replayed if necessary. However, some of these places were missing the necessary reinitializations of certain local variables before replay. This change makes sure that these variables get initialized after the label. Cc: stable@vger.kernel.org Reported-by: Yuchan Nam <entropy1110@gmail.com> Tested-by: Yuchan Nam <entropy1110@gmail.com> Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f1ae403 commit 7c9ce68

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

fs/smb/client/smb2ops.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
11841184

11851185
replay_again:
11861186
/* reinitialize for possible replay */
1187+
used_len = 0;
11871188
flags = CIFS_CP_CREATE_CLOSE_OP;
11881189
oplock = SMB2_OPLOCK_LEVEL_NONE;
11891190
server = cifs_pick_channel(ses);
@@ -1582,6 +1583,7 @@ smb2_ioctl_query_info(const unsigned int xid,
15821583

15831584
replay_again:
15841585
/* reinitialize for possible replay */
1586+
buffer = NULL;
15851587
flags = CIFS_CP_CREATE_CLOSE_OP;
15861588
oplock = SMB2_OPLOCK_LEVEL_NONE;
15871589
server = cifs_pick_channel(ses);

fs/smb/client/smb2pdu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,6 +2845,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
28452845

28462846
replay_again:
28472847
/* reinitialize for possible replay */
2848+
pc_buf = NULL;
28482849
flags = 0;
28492850
n_iov = 2;
28502851
server = cifs_pick_channel(ses);

0 commit comments

Comments
 (0)