On Wed, Aug 12, 2020 at 08:25:37PM -0700, Richard Henderson wrote: > With gcrypt, most of the dispatch happens in the library, > so there aren't many classes to create. However, we can > still create separate dispatch for CTR mode, and for > CONFIG_QEMU_PRIVATE_XTS, which avoids needing to check > for these modes at runtime. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > crypto/cipher-gcrypt.inc.c | 512 ++++++++++++++++++------------------- > 1 file changed, 250 insertions(+), 262 deletions(-) > > diff --git a/crypto/cipher-gcrypt.inc.c b/crypto/cipher-gcrypt.inc.c > index 7a1fbc9745..1f9d08a7fa 100644 > --- a/crypto/cipher-gcrypt.inc.c > +++ b/crypto/cipher-gcrypt.inc.c > @@ -24,8 +24,6 @@ >
> > - error: > - qcrypto_gcrypt_cipher_free_ctx(ctx, mode); > + error3: > +#ifdef CONFIG_QEMU_PRIVATE_XTS > + gcry_cipher_close(ctx->tweakhandle); > + error2: > +#endif > + gcry_cipher_close(ctx->handle); > + error1: > + g_free(ctx); gcry_cipher_close is a no-op if the handle is NULL, so I don't think we need to have a chain of jump targets, just a single "error:". Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|