Get page size should never fail (in the works case it fails later with wrong alignment).

This commit is contained in:
Milan Broz
2012-12-10 17:47:06 +01:00
parent 80d21c039e
commit 50d5cfa8bc
3 changed files with 5 additions and 13 deletions

View File

@@ -128,14 +128,9 @@ static int cipher_perf(struct cipher_perf *cp,
{
long ms_enc, ms_dec, ms;
int repeat_enc, repeat_dec;
size_t alignment;
void *buf = NULL;
alignment = crypt_getpagesize();
if (alignment < 0)
return -EINVAL;
if (posix_memalign(&buf, alignment, cp->buffer_size))
if (posix_memalign(&buf, crypt_getpagesize(), cp->buffer_size))
return -ENOMEM;
ms_enc = 0;