From 69a6819c025d7658f97747410d93464e2326e41a Mon Sep 17 00:00:00 2001 From: Stefano Babic Date: Sun, 28 Jun 2020 17:17:01 +0200 Subject: [PATCH] Fix coverity #293503 and #293507 Signed-off-by: Stefano Babic --- src/uboot_env.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uboot_env.c b/src/uboot_env.c index 637b61d..8917513 100644 --- a/src/uboot_env.c +++ b/src/uboot_env.c @@ -1371,7 +1371,7 @@ int libuboot_initialize(struct uboot_ctx **out, } int libuboot_open(struct uboot_ctx *ctx) { - if (!ctx || !ctx->envdevs) + if (!ctx) return -EINVAL; libuboot_lock(ctx); @@ -1381,7 +1381,7 @@ int libuboot_open(struct uboot_ctx *ctx) { void libuboot_close(struct uboot_ctx *ctx) { struct var_entry *e, *tmp; - if (!ctx || !ctx->envdevs) + if (!ctx) return; ctx->valid = false; libuboot_unlock(ctx);