From: Namjae Jeon Date: Wed, 26 May 2021 06:53:26 +0000 (+0900) Subject: cifsd: change success handling to failure handling X-Git-Tag: accepted/tizen/unified/20230118.172025~6553^2~18^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73b8b08539423a888ed76b53401a6366e0e2af2b;p=platform%2Fkernel%2Flinux-rpi.git cifsd: change success handling to failure handling Change success handling to failure handling in ksmbd_crypt_message(). Reviewed-by: Dan Carpenter Signed-off-by: Namjae Jeon Signed-off-by: Steve French --- diff --git a/fs/cifsd/auth.c b/fs/cifsd/auth.c index 5a56dd6..b0a9e45 100644 --- a/fs/cifsd/auth.c +++ b/fs/cifsd/auth.c @@ -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);