Skip to content

Commit a312334

Browse files
gscuichucklever
authored andcommitted
gss_krb5: Fix the error handling path for crypto_sync_skcipher_setkey
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: 4891f2d ("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>
1 parent f436833 commit a312334

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/auth_gss/gss_krb5_keys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int krb5_DK(const struct gss_krb5_enctype *gk5e,
168168
goto err_return;
169169
blocksize = crypto_sync_skcipher_blocksize(cipher);
170170
if (crypto_sync_skcipher_setkey(cipher, inkey->data, inkey->len))
171-
goto err_return;
171+
goto err_free_cipher;
172172

173173
ret = -ENOMEM;
174174
inblockdata = kmalloc(blocksize, gfp_mask);

0 commit comments

Comments
 (0)