Blame SOURCES/0008-efi_va_generate_file_device_path_from_esp-handle-err.patch

ac385c
From 537d3d37d1091080362e11a6fa99b9f31cb48e53 Mon Sep 17 00:00:00 2001
ac385c
From: Peter Jones <pjones@redhat.com>
ac385c
Date: Mon, 1 May 2017 14:48:49 -0400
ac385c
Subject: [PATCH 08/22] efi_va_generate_file_device_path_from_esp(): handle
ac385c
 errors better.
ac385c
ac385c
When efi_va_generate_file_device_path_from_esp() gets an error from
ac385c
efidp_make_edd10() or make_blockdev_path(), it fails to close the file
ac385c
descriptor it uses to do ioctl() against the disk.  So make it use the
ac385c
common error path for those as well.
ac385c
ac385c
Found by covscan.
ac385c
ac385c
Signed-off-by: Peter Jones <pjones@redhat.com>
ac385c
---
ac385c
 src/creator.c | 6 +++---
ac385c
 1 file changed, 3 insertions(+), 3 deletions(-)
ac385c
ac385c
diff --git a/src/creator.c b/src/creator.c
ac385c
index 6d662b7..ccd0faf 100644
ac385c
--- a/src/creator.c
ac385c
+++ b/src/creator.c
ac385c
@@ -180,7 +180,7 @@ efi_va_generate_file_device_path_from_esp(uint8_t *buf, ssize_t size,
ac385c
 				       uint32_t options, va_list ap)
ac385c
 {
ac385c
 	int rc;
ac385c
-	ssize_t ret = -1, off=0, sz;
ac385c
+	ssize_t ret = -1, off = 0, sz;
ac385c
 	struct disk_info info = { 0, };
ac385c
 	int fd = -1;
ac385c
 	int saved_errno;
ac385c
@@ -215,7 +215,7 @@ efi_va_generate_file_device_path_from_esp(uint8_t *buf, ssize_t size,
ac385c
 		sz = efidp_make_edd10(buf, size, info.edd10_devicenum);
ac385c
 		if (sz < 0) {
ac385c
 			efi_error("could not make EDD 1.0 device path");
ac385c
-			return -1;
ac385c
+			goto err;
ac385c
 		}
ac385c
 		off = sz;
ac385c
 	} else if (!(options & EFIBOOT_ABBREV_FILE)
ac385c
@@ -228,7 +228,7 @@ efi_va_generate_file_device_path_from_esp(uint8_t *buf, ssize_t size,
ac385c
 		sz = make_blockdev_path(buf, size, &info;;
ac385c
 		if (sz < 0) {
ac385c
 			efi_error("could not create device path");
ac385c
-			return -1;
ac385c
+			goto err;
ac385c
 		}
ac385c
 		off += sz;
ac385c
 	}
ac385c
-- 
ac385c
2.12.2
ac385c