aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@linux.intel.com>2011-06-17 11:49:23 +0100
committerMatt Fleming <matt.fleming@linux.intel.com>2011-07-22 13:00:01 +0100
commit933999e55549b4c005f62d35e702a324d6d6497d (patch)
tree95349a09c97659f824f8c6bf29f5704202c169a3
parent692986e9a44ffc427b100bac83a0a08151c9954b (diff)
downloadefilinux-933999e55549b4c005f62d35e702a324d6d6497d.tar.gz
efilinux: Pass correct size to exit()
The @size argument to exit() should be the size, in bytes, of @reason. Previously we were passing whatever value was left in 'size' in efi_main(). We should instead be passing ERROR_STRING_LENGTH because that is the size of the allocation holding @reason. Also, cleanup a typo in the documentation for exit() where the explanation of the @size argument referred to a nonexistent @data argument. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
-rw-r--r--efilinux.h2
-rw-r--r--entry.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/efilinux.h b/efilinux.h
index 5ba1be7..fe85c0a 100644
--- a/efilinux.h
+++ b/efilinux.h
@@ -161,7 +161,7 @@ exit_boot_services(EFI_HANDLE image, UINTN key)
* exit - Terminate a loaded EFI image
* @image: firmware-allocated handle that identifies the image
* @status: the image's exit code
- * @size: size in bytes of @data. Ignored if @status is EFI_SUCCESS
+ * @size: size in bytes of @reason. Ignored if @status is EFI_SUCCESS
* @reason: a NUL-terminated status string, optionally followed by binary data
*
* This function terminates @image and returns control to the boot
diff --git a/entry.c b/entry.c
index 5929a86..dadb786 100644
--- a/entry.c
+++ b/entry.c
@@ -184,5 +184,5 @@ failed:
StatusToString(error_buf, err);
Print(L": %s\n", error_buf);
- return exit(image, err, size, error_buf);
+ return exit(image, err, ERROR_STRING_LENGTH, error_buf);
}