mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
smb3: missing lock when picking channel
Coverity spotted a place where we should have been holding the
channel lock when accessing the ses channel index.
Addresses-Coverity: 1582039 ("Data race condition (MISSING_LOCK)")
Cc: stable@vger.kernel.org
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
9a1f1d04f6
commit
8094a60024
|
|
@ -1057,9 +1057,11 @@ struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses)
|
|||
index = (uint)atomic_inc_return(&ses->chan_seq);
|
||||
index %= ses->chan_count;
|
||||
}
|
||||
|
||||
server = ses->chans[index].server;
|
||||
spin_unlock(&ses->chan_lock);
|
||||
|
||||
return ses->chans[index].server;
|
||||
return server;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user