summaryrefslogtreecommitdiff
path: root/tests/vboot_api_kernel5_tests.c
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-04-10 17:11:59 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-04-17 21:32:26 -0700
commit144d06f8e74d8c4aa25d24a8e483db3e841e9e7d (patch)
tree71dff1821aed923e96a72de5ff7df6cb272e1d73 /tests/vboot_api_kernel5_tests.c
parentdccea9ae88059c8cb7dff76d2682835184fc8338 (diff)
downloadvboot-144d06f8e74d8c4aa25d24a8e483db3e841e9e7d.tar.gz
vboot: remove workbuf alloc and free code
Workbuf should be allocated and free'd by vboot caller. BUG=b:124141368, chromium:951692 TEST=make clean && make runtests CQ-DEPEND=CL:1563872 BRANCH=none Change-Id: Ibaa70f62c660d46cc083a5e55a73b961eb813649 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/1560716 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'tests/vboot_api_kernel5_tests.c')
-rw-r--r--tests/vboot_api_kernel5_tests.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/vboot_api_kernel5_tests.c b/tests/vboot_api_kernel5_tests.c
index 65899aec..8d3281be 100644
--- a/tests/vboot_api_kernel5_tests.c
+++ b/tests/vboot_api_kernel5_tests.c
@@ -27,6 +27,7 @@
#include "vboot_struct.h"
/* Mock data */
+static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
static struct vb2_context ctx;
static struct vb2_context ctx_nvram_backend;
static VbCommonParams cparams;
@@ -67,9 +68,11 @@ static void ResetMocks(void)
gbb->rootkey_offset = sizeof(*gbb);
gbb->rootkey_size = sizeof(VbPublicKey);
- /* ctx.workbuf will be allocated and initialized by
- * VbVerifyMemoryBootImage. */
+ /* ctx.workbuf will be initialized by VbVerifyMemoryBootImage. */
memset(&ctx, 0, sizeof(ctx));
+ ctx.workbuf = workbuf;
+ ctx.workbuf_size = sizeof(workbuf);
+ vb2_init_context(&ctx);
/*
* ctx_nvram_backend is only used as an NVRAM backend (see