Remove unnecessary goto from cipher kernel wrapper.

This commit is contained in:
Milan Broz
2021-02-12 11:58:18 +01:00
parent f5dd3c8e32
commit 4309294c2a

View File

@@ -164,15 +164,14 @@ static int _crypt_cipher_crypt(struct crypt_cipher_kernel *ctx,
} }
len = sendmsg(ctx->opfd, &msg, 0); len = sendmsg(ctx->opfd, &msg, 0);
if (len != (ssize_t)(in_length)) { if (len != (ssize_t)(in_length))
r = -EIO; r = -EIO;
goto bad; else {
len = read(ctx->opfd, out, out_length);
if (len != (ssize_t)out_length)
r = -EIO;
} }
len = read(ctx->opfd, out, out_length);
if (len != (ssize_t)out_length)
r = -EIO;
bad:
crypt_backend_memzero(buffer, sizeof(buffer)); crypt_backend_memzero(buffer, sizeof(buffer));
return r; return r;
} }