Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79957e62 authored by Gaosheng Cui's avatar Gaosheng Cui Committed by Greg Kroah-Hartman
Browse files

gss_krb5: Fix the error handling path for crypto_sync_skcipher_setkey



[ Upstream commit a3123341dc358952ce2bf8067fbdfb7eaadf71bb ]

If we fail to call crypto_sync_skcipher_setkey, we should free the
memory allocation for cipher, replace err_return with err_free_cipher
to free the memory of cipher.

Fixes: 4891f2d0 ("gss_krb5: import functionality to derive keys into the kernel")
Signed-off-by: default avatarGaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 994fc216
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ u32 krb5_derive_key(const struct gss_krb5_enctype *gk5e,
	if (IS_ERR(cipher))
		goto err_return;
	if (crypto_sync_skcipher_setkey(cipher, inkey->data, inkey->len))
		goto err_return;
		goto err_free_cipher;

	/* allocate and set up buffers */