Commit d3cd8c49 authored by Namjae Jeon's avatar Namjae Jeon

cifsd: simplify error handling in ksmbd_gen_preauth_integrity_hash()

Simplify error handling in ksmbd_gen_preauth_integrity_hash().
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 12fc7044
...@@ -1063,14 +1063,13 @@ int ksmbd_gen_preauth_integrity_hash(struct ksmbd_conn *conn, char *buf, ...@@ -1063,14 +1063,13 @@ int ksmbd_gen_preauth_integrity_hash(struct ksmbd_conn *conn, char *buf,
int msg_size = be32_to_cpu(rcv_hdr->smb2_buf_length); int msg_size = be32_to_cpu(rcv_hdr->smb2_buf_length);
struct ksmbd_crypto_ctx *ctx = NULL; struct ksmbd_crypto_ctx *ctx = NULL;
if (conn->preauth_info->Preauth_HashId == if (conn->preauth_info->Preauth_HashId !=
SMB2_PREAUTH_INTEGRITY_SHA512) { SMB2_PREAUTH_INTEGRITY_SHA512)
ctx = ksmbd_crypto_ctx_find_sha512(); return -EINVAL;
if (!ctx) {
ksmbd_debug(AUTH, "could not alloc sha512 rc %d\n", rc); ctx = ksmbd_crypto_ctx_find_sha512();
goto out; if (!ctx) {
} ksmbd_debug(AUTH, "could not alloc sha512 rc %d\n", rc);
} else {
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment