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

38ab4d
From 397a7b6d58f3d4ae264795a3925234266069b1c5 Mon Sep 17 00:00:00 2001
5fb29d
From: Peter Jones <pjones@redhat.com>
5fb29d
Date: Wed, 10 Sep 2014 15:29:43 -0400
38ab4d
Subject: [PATCH 03/31] 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
38ab4d
index c2c7284..5ca97ab 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
-- 
38ab4d
2.7.4
5fb29d