summaryrefslogtreecommitdiffstats
path: root/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch')
-rw-r--r--meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch
new file mode 100644
index 0000000..75374ac
--- /dev/null
+++ b/meta-linaro/recipes-extra/efibootmgr/files/efibootmgr-0.5.4-make_boot_var-does-not-check-for-failed-status-with-.patch
@@ -0,0 +1,47 @@
1From 5fcfccb39089febb89945b841f489b5acc7638ce Mon Sep 17 00:00:00 2001
2From: Lane Winner <lane.winner@oracle.com>
3Date: Tue, 24 Apr 2012 12:58:57 -0500
4Subject: [PATCH 5/5] make_boot_var does not check for failed status with
5 create_variable. This can result in a memory leak.
6 Additionally the user should be notified of the
7 problem.
8
9We encounter this issue on one system after filling up the UEFI boot list
10with dummy devices.
11
12The patch fix the problem. It was verified on a Mensa system using RHEL 6.0
13
14Signed-off-by: Yinghai Lu<yinghai@kernel.org>
15---
16 src/efibootmgr/efibootmgr.c | 8 +++++++-
17 1 file changed, 7 insertions(+), 1 deletion(-)
18
19diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
20index de67af0..236365a 100644
21--- a/src/efibootmgr/efibootmgr.c
22+++ b/src/efibootmgr/efibootmgr.c
23@@ -239,6 +239,7 @@ warn_duplicate_name(list_t *boot_list)
24 static var_entry_t *
25 make_boot_var(list_t *boot_list)
26 {
27+ efi_status_t status;
28 var_entry_t *boot;
29 int free_number;
30 list_t *pos;
31@@ -271,7 +272,12 @@ make_boot_var(list_t *boot_list)
32 free(boot);
33 return NULL;
34 }
35- create_variable(&boot->var_data);
36+
37+ status = create_variable(&boot->var_data);
38+ if (status != EFI_SUCCESS) {
39+ free(boot);
40+ return NULL;
41+ }
42 list_add_tail(&boot->list, boot_list);
43 return boot;
44 }
45--
461.8.0
47