mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
smb: server: smb2pdu: check return value of xa_store()
xa_store() may fail so check its return value and return error code if error occurred. Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
9c32cda43e
commit
af5226abb4
|
|
@ -1445,7 +1445,7 @@ static int ntlm_authenticate(struct ksmbd_work *work,
|
|||
{
|
||||
struct ksmbd_conn *conn = work->conn;
|
||||
struct ksmbd_session *sess = work->sess;
|
||||
struct channel *chann = NULL;
|
||||
struct channel *chann = NULL, *old;
|
||||
struct ksmbd_user *user;
|
||||
u64 prev_id;
|
||||
int sz, rc;
|
||||
|
|
@ -1557,7 +1557,12 @@ static int ntlm_authenticate(struct ksmbd_work *work,
|
|||
return -ENOMEM;
|
||||
|
||||
chann->conn = conn;
|
||||
xa_store(&sess->ksmbd_chann_list, (long)conn, chann, KSMBD_DEFAULT_GFP);
|
||||
old = xa_store(&sess->ksmbd_chann_list, (long)conn, chann,
|
||||
KSMBD_DEFAULT_GFP);
|
||||
if (xa_is_err(old)) {
|
||||
kfree(chann);
|
||||
return xa_err(old);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user