
From: Namjae Jeon <namjae.jeon@samsung.com> mainline inclusion from mainline-5.15-rc1 commit 7e38ea254c8274ea25ffc28df65ac2683c5f8a72 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/7e38ea254c82 ------------------------------- Move ret check before the out label. 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> Signed-off-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Zhong Jinghua <zhongjinghua@huawei.com> --- fs/cifsd/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifsd/auth.c b/fs/cifsd/auth.c index ab698093f728..092db15e4234 100644 --- a/fs/cifsd/auth.c +++ b/fs/cifsd/auth.c @@ -311,9 +311,9 @@ static int calc_ntlmv2_hash(struct ksmbd_session *sess, char *ntlmv2_hash, } ret = crypto_shash_final(CRYPTO_HMACMD5(ctx), ntlmv2_hash); -out: if (ret) ksmbd_debug(AUTH, "Could not generate md5 hash\n"); +out: kfree(uniname); kfree(domain); ksmbd_release_crypto_ctx(ctx); -- 2.31.1