Blob Blame History Raw
From 397a7b6d58f3d4ae264795a3925234266069b1c5 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 10 Sep 2014 15:29:43 -0400
Subject: [PATCH 03/31] Make the return path something coverity can actually
 understand.

It was *correct* before, but there's no reason to do it that weird way.

Signed-off-by: Peter Jones <pjones@redhat.com>
---
 src/efibootmgr/efibootmgr.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
index c2c7284..5ca97ab 100644
--- a/src/efibootmgr/efibootmgr.c
+++ b/src/efibootmgr/efibootmgr.c
@@ -805,14 +805,17 @@ show_boot_order()
 
 	rc = read_boot_order(&boot_order);
 
-	if (rc < 0 && errno == ENOENT) {
-		boot_order = calloc(1, sizeof (*boot_order));
-		rc = boot_order ? 0 : -1;
-	}
-
 	if (rc < 0) {
-		perror("show_boot_order()");
-		return;
+		if (errno == ENOENT) {
+			boot_order = calloc(1, sizeof (*boot_order));
+			if (!boot_order) {
+				perror("show_boot_order()");
+				return;
+			}
+		} else {
+			perror("show_boot_order()");
+			return;
+		}
 	}
 
 	/* We've now got an array (in boot_order->data) of the
-- 
2.7.4