From d13a57915df7e7eea217d6efba0b4051ca7fa838 Mon Sep 17 00:00:00 2001 From: Sridhar Siricilla Date: Mon, 19 Dec 2022 15:05:59 +0530 Subject: security/vboot: Drop assert call from vbnv_udc_enable_flag() It's true that vbnv_udc_enable_flag() is called after vbnv_init() (that's why the assertion was added). However, the former is called in the ramstage, while the latter in verstage. This means that vbnv_initialized will be false in ramstage, which leads to the assertion failure: [EMERG] ASSERTION ERROR: file 'src/security/vboot/vbnv.c', line 88 Since the ctx->nvdata will be restored in ramstage (by vb2api_reinit()), simply remove the assertion. So, the patch drops assert call from vbnv_udc_enable_flag() function. TEST=Verify Rex system boots to OS without assert error. Signed-off-by: Sridhar Siricilla Change-Id: I49022155239febd5c5be5cf2c5eca2019ca61c12 Reviewed-on: https://review.coreboot.org/c/coreboot/+/71097 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu Reviewed-by: Karthik Ramasubramanian --- src/security/vboot/vbnv.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/security/vboot') diff --git a/src/security/vboot/vbnv.c b/src/security/vboot/vbnv.c index 1428a30b33..2ddb89803d 100644 --- a/src/security/vboot/vbnv.c +++ b/src/security/vboot/vbnv.c @@ -82,11 +82,6 @@ void save_vbnv(const uint8_t *vbnv_copy) int vbnv_udc_enable_flag(void) { struct vb2_context *ctx = vboot_get_context(); - - /* This function is expected to be called after temporary nvdata storage in vboot - context is initialized. */ - assert(vbnv_initialized); - return (ctx->nvdata[DEV_FLAGS_OFFSET] & DEV_ENABLE_UDC) ? 1 : 0; } -- cgit v1.2.3