~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to grub-core/loader/efi/chainloader.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-05-17 23:59:10 UTC
  • mto: (17.3.55 sid)
  • mto: This revision was merged to the branch mainline in revision 122.
  • Revision ID: james.westby@ubuntu.com-20110517235910-ma8u889vyjdfro27
Tags: upstream-1.99
ImportĀ upstreamĀ versionĀ 1.99

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include <grub/command.h>
36
36
#include <grub/i18n.h>
37
37
 
 
38
GRUB_MOD_LICENSE ("GPLv3+");
 
39
 
38
40
static grub_dl_t my_mod;
39
41
 
40
42
static grub_efi_physical_address_t address;
55
57
  grub_free (file_path);
56
58
  grub_free (cmdline);
57
59
  cmdline = 0;
 
60
  file_path = 0;
58
61
 
59
62
  grub_dl_unref (my_mod);
60
63
  return GRUB_ERR_NONE;
66
69
  grub_efi_boot_services_t *b;
67
70
  grub_efi_status_t status;
68
71
  grub_efi_uintn_t exit_data_size;
69
 
  grub_efi_char16_t *exit_data;
 
72
  grub_efi_char16_t *exit_data = NULL;
70
73
 
71
74
  b = grub_efi_system_table->boot_services;
72
75
  status = efi_call_3 (b->start_image, image_handle, &exit_data_size, &exit_data);
93
96
  if (exit_data)
94
97
    efi_call_1 (b->free_pool, exit_data);
95
98
 
96
 
  grub_chainloader_unload ();
 
99
  grub_loader_unset ();
97
100
 
98
101
  return grub_errno;
99
102
}
236
239
  grub_efi_print_device_path (file_path);
237
240
 
238
241
  size = grub_file_size (file);
 
242
  if (!size)
 
243
    {
 
244
      grub_error (GRUB_ERR_BAD_OS, "file is empty");
 
245
      goto fail;
 
246
    }
239
247
  pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12);
240
248
 
241
249
  status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES,