projects
/
platform
/
upstream
/
cryptsetup.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some problems found by Coverity scan.
[platform/upstream/cryptsetup.git]
/
lib
/
utils_benchmark.c
diff --git
a/lib/utils_benchmark.c
b/lib/utils_benchmark.c
index
4ee0c03
..
f392382
100644
(file)
--- a/
lib/utils_benchmark.c
+++ b/
lib/utils_benchmark.c
@@
-128,9
+128,14
@@
static int cipher_perf(struct cipher_perf *cp,
{
long ms_enc, ms_dec, ms;
int repeat_enc, repeat_dec;
{
long ms_enc, ms_dec, ms;
int repeat_enc, repeat_dec;
+ size_t alignment;
void *buf = NULL;
void *buf = NULL;
- if (posix_memalign(&buf, crypt_getpagesize(), cp->buffer_size))
+ alignment = crypt_getpagesize();
+ if (alignment < 0)
+ return -EINVAL;
+
+ if (posix_memalign(&buf, alignment, cp->buffer_size))
return -ENOMEM;
ms_enc = 0;
return -ENOMEM;
ms_enc = 0;