libkcapi/003-fix-test-case.patch
Ondrej Mosnacek 3d486e6132 Backport patch to fix test failure on aarch64
Another patch needed to fix failing tests...

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2019-07-27 22:10:09 +02:00

36 lines
922 B
Diff

From b455bb77dcf7a38bb881898efcd5122aa61e68cc Mon Sep 17 00:00:00 2001
From: Stephan Mueller <smueller@chronox.de>
Date: Mon, 27 May 2019 13:21:03 +0200
Subject: [PATCH] fix test case
- fix possible mem leak
- fix counting of available memory
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
test/kcapi-main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/kcapi-main.c b/test/kcapi-main.c
index 46cce51..bce21b7 100644
--- a/test/kcapi-main.c
+++ b/test/kcapi-main.c
@@ -282,6 +282,7 @@ static int fuzz_init_test(unsigned int size)
if (get_random(name, size, 0)) {
printf("get_random call failed\n");
+ free(name);
return 1;
}
@@ -1016,7 +1017,7 @@ static int cavs_sym_stream(struct kcapi_cavs *cavs_test, uint32_t loops,
}
outiov.iov_base = (uint8_t *)outiov.iov_base + ret;
- outiov.iov_len += ret;
+ outiov.iov_len -= ret;
outptr += ret;
}