From c2f19f1cb4fa2bc73d29d0e898e1799382a43735 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 10 Sep 2014 15:29:43 -0400
Subject: [PATCH 02/18] 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 5af2cad..1c65c07 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
--
1.9.3