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: 4891f2d008e4 ("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>

authored by Gaosheng Cui and committed by Chuck Lever a3123341 f436833a

+1 -1
+1 -1
net/sunrpc/auth_gss/gss_krb5_keys.c
··· 168 goto err_return; 169 blocksize = crypto_sync_skcipher_blocksize(cipher); 170 if (crypto_sync_skcipher_setkey(cipher, inkey->data, inkey->len)) 171 - goto err_return; 172 173 ret = -ENOMEM; 174 inblockdata = kmalloc(blocksize, gfp_mask);
··· 168 goto err_return; 169 blocksize = crypto_sync_skcipher_blocksize(cipher); 170 if (crypto_sync_skcipher_setkey(cipher, inkey->data, inkey->len)) 171 + goto err_free_cipher; 172 173 ret = -ENOMEM; 174 inblockdata = kmalloc(blocksize, gfp_mask);