cifsd: change success handling to failure handling

Change success handling to failure handling in ksmbd_crypt_message().

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
Namjae Jeon 2021-05-26 15:53:26 +09:00
Родитель 27aa646db0
Коммит 73b8b08539
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -1331,9 +1331,13 @@ int ksmbd_crypt_message(struct ksmbd_conn *conn, struct kvec *iov,
rc = crypto_aead_encrypt(req);
else
rc = crypto_aead_decrypt(req);
if (!rc && enc)
if (rc)
goto free_iv;
if (enc)
memcpy(&tr_hdr->Signature, sign, SMB2_SIGNATURE_SIZE);
free_iv:
kfree(iv);
free_sg:
kfree(sg);