diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2022-09-13 09:56:22 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-09-15 13:02:33 +0000 |
commit | aebccac7e10eb581e8e7d3354289cfed76860a3e (patch) | |
tree | ffb8e6a5bb256f8675e0496f27c6991c524d1e9b /src/security/vboot | |
parent | a6b41f2fd05c61ea74bea4a40d02250e9b37bee0 (diff) |
src/security: Use "if (!ptr)" in preference to "if (ptr == NULL)"
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Change-Id: I3def65c016015d8213824e6b8561d8a67b6d5cf0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67579
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/security/vboot')
-rw-r--r-- | src/security/vboot/common.c | 6 | ||||
-rw-r--r-- | src/security/vboot/ec_sync.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/security/vboot/common.c b/src/security/vboot/common.c index c2d9340217..7f1aee1820 100644 --- a/src/security/vboot/common.c +++ b/src/security/vboot/common.c @@ -17,10 +17,10 @@ static void *vboot_get_workbuf(void) if (cbmem_possibly_online()) wb = cbmem_find(CBMEM_ID_VBOOT_WORKBUF); - if (wb == NULL && !CONFIG(VBOOT_STARTS_IN_ROMSTAGE) && preram_symbols_available()) + if (!wb && !CONFIG(VBOOT_STARTS_IN_ROMSTAGE) && preram_symbols_available()) wb = _vboot2_work; - assert(wb != NULL); + assert(wb); return wb; } @@ -72,7 +72,7 @@ static void vboot_setup_cbmem(int unused) vb2_error_t rv; const size_t cbmem_size = VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE; void *wb_cbmem = cbmem_add(CBMEM_ID_VBOOT_WORKBUF, cbmem_size); - assert(wb_cbmem != NULL); + assert(wb_cbmem); /* * On platforms where VBOOT_STARTS_BEFORE_BOOTBLOCK, the verification * occurs before the main processor starts running. The vboot data- diff --git a/src/security/vboot/ec_sync.c b/src/security/vboot/ec_sync.c index 5b3287ed13..b3b17dd10e 100644 --- a/src/security/vboot/ec_sync.c +++ b/src/security/vboot/ec_sync.c @@ -383,7 +383,7 @@ static vb2_error_t ec_get_expected_hash(enum vb2_firmware_selection select, /* vboot has no API to return this memory, so must permanently leak a mapping here. */ const uint8_t *file = cbfs_map(filename, &size); - if (file == NULL) + if (!file) return VB2_ERROR_UNKNOWN; *hash = file; |