mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 18:55:12 +00:00
gss_krb5: Fix the error handling path for crypto_sync_skcipher_setkey
[ Upstream commita3123341dc
] 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:4891f2d008
("gss_krb5: import functionality to derive keys into the kernel") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d3cc85a10a
commit
17f40e25f8
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user