Blame SOURCES/0002-Make-the-return-path-something-coverity-can-actually.patch

5fb29d
From c2f19f1cb4fa2bc73d29d0e898e1799382a43735 Mon Sep 17 00:00:00 2001
5fb29d
From: Peter Jones <pjones@redhat.com>
5fb29d
Date: Wed, 10 Sep 2014 15:29:43 -0400
5fb29d
Subject: [PATCH 02/18] Make the return path something coverity can actually
5fb29d
 understand.
5fb29d
5fb29d
It was *correct* before, but there's no reason to do it that weird way.
5fb29d
5fb29d
Signed-off-by: Peter Jones <pjones@redhat.com>
5fb29d
---
5fb29d
 src/efibootmgr/efibootmgr.c | 17 ++++++++++-------
5fb29d
 1 file changed, 10 insertions(+), 7 deletions(-)
5fb29d
5fb29d
diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
5fb29d
index 5af2cad..1c65c07 100644
5fb29d
--- a/src/efibootmgr/efibootmgr.c
5fb29d
+++ b/src/efibootmgr/efibootmgr.c
5fb29d
@@ -805,14 +805,17 @@ show_boot_order()
5fb29d
 
5fb29d
 	rc = read_boot_order(&boot_order);
5fb29d
 
5fb29d
-	if (rc < 0 && errno == ENOENT) {
5fb29d
-		boot_order = calloc(1, sizeof (*boot_order));
5fb29d
-		rc = boot_order ? 0 : -1;
5fb29d
-	}
5fb29d
-
5fb29d
 	if (rc < 0) {
5fb29d
-		perror("show_boot_order()");
5fb29d
-		return;
5fb29d
+		if (errno == ENOENT) {
5fb29d
+			boot_order = calloc(1, sizeof (*boot_order));
5fb29d
+			if (!boot_order) {
5fb29d
+				perror("show_boot_order()");
5fb29d
+				return;
5fb29d
+			}
5fb29d
+		} else {
5fb29d
+			perror("show_boot_order()");
5fb29d
+			return;
5fb29d
+		}
5fb29d
 	}
5fb29d
 
5fb29d
 	/* We've now got an array (in boot_order->data) of the
5fb29d
-- 
5fb29d
1.9.3
5fb29d