mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-22 06:15:06 -04:00
ksmbd: check return value of xa_store() in krb5_authenticate
xa_store() may fail so check its return value and return error code if error occurred. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
committed by
Steve French
parent
9b493ab6f3
commit
ecd9d6bf88
@@ -1594,7 +1594,7 @@ static int krb5_authenticate(struct ksmbd_work *work,
|
||||
struct ksmbd_conn *conn = work->conn;
|
||||
struct ksmbd_session *sess = work->sess;
|
||||
char *in_blob, *out_blob;
|
||||
struct channel *chann = NULL;
|
||||
struct channel *chann = NULL, *old;
|
||||
u64 prev_sess_id;
|
||||
int in_len, out_len;
|
||||
int retval;
|
||||
@@ -1660,7 +1660,12 @@ static int krb5_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user