~ilya-yanok/ubuntu/precise/grub2/fix-for-948716

« back to all changes in this revision

Viewing changes to loader/i386/xnu.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Millan
  • Date: 2009-07-25 19:00:53 UTC
  • mfrom: (1.6.3 upstream)
  • mto: (17.4.13 sid)
  • mto: This revision was merged to the branch mainline in revision 53.
  • Revision ID: james.westby@ubuntu.com-20090725190053-uv3lm6ya3zxs77ep
ImportĀ upstreamĀ versionĀ 1.96+20090725

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
  curval->datasize = (SYSTEM_TABLE_SIZEOF (firmware_revision));
248
248
  curval->data = grub_malloc (curval->datasize);
249
249
  if (! curval->data)
250
 
    return grub_errno;
 
250
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree");
251
251
  grub_memcpy (curval->data, (SYSTEM_TABLE_VAR(firmware_revision)),
252
252
               curval->datasize);
253
253
 
258
258
    2 * (utf16_strlen (SYSTEM_TABLE_PTR (firmware_vendor)) + 1);
259
259
  curval->data = grub_malloc (curval->datasize);
260
260
  if (! curval->data)
261
 
    return grub_errno;
 
261
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree");
262
262
  grub_memcpy (curval->data, SYSTEM_TABLE_PTR (firmware_vendor),
263
263
               curval->datasize);
264
264
 
268
268
  curval->datasize = sizeof ("EFI32");
269
269
  curval->data = grub_malloc (curval->datasize);
270
270
  if (! curval->data)
271
 
    return grub_errno;
 
271
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree");
272
272
  if (SIZEOF_OF_UINTN == 4)
273
273
    grub_memcpy (curval->data, "EFI32", curval->datasize);
274
274
  else
287
287
  curval->datasize = sizeof (grub_uint64_t);
288
288
  curval->data = grub_malloc (curval->datasize);
289
289
  if (!curval->data)
290
 
    return grub_errno;
 
290
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree");
291
291
 
292
292
  /* First see if user supplies the value. */
293
293
  char *fsbvar = grub_env_get ("fsb");
362
362
      curval->datasize = sizeof (guid);
363
363
      curval->data = grub_malloc (curval->datasize);
364
364
      if (! curval->data)
365
 
        return grub_errno;
 
365
        return grub_error (GRUB_ERR_OUT_OF_MEMORY,
 
366
                           "couldn't create device tree");
366
367
      grub_memcpy (curval->data, &guid, curval->datasize);
367
368
 
368
369
      /* The value "table". */
372
373
      curval->datasize = SIZEOF_OF_UINTN;
373
374
      curval->data = grub_malloc (curval->datasize);
374
375
      if (! curval->data)
375
 
        return grub_errno;
 
376
        return grub_error (GRUB_ERR_OUT_OF_MEMORY,
 
377
                           "couldn't create device tree");
376
378
      if (SIZEOF_OF_UINTN == 4)
377
379
        *((grub_uint32_t *)curval->data) = PTR_TO_UINT32 (ptr);
378
380
      else
390
392
          curval->datasize = grub_strlen (table_aliases[j].name) + 1;
391
393
          curval->data = grub_malloc (curval->datasize);
392
394
          if (!curval->data)
393
 
            return grub_errno;
 
395
            return grub_error (GRUB_ERR_OUT_OF_MEMORY,
 
396
                               "couldn't create device tree");
394
397
          grub_memcpy (curval->data, table_aliases[j].name, curval->datasize);
395
398
        }
396
399
    }
406
409
  curval->datasize = SIZEOF_OF_UINTN;
407
410
  curval->data = grub_malloc (curval->datasize);
408
411
  if (! curval->data)
409
 
    return grub_errno;
 
412
    return grub_error (GRUB_ERR_OUT_OF_MEMORY,
 
413
                       "couldn't create device tree");
410
414
  if (SIZEOF_OF_UINTN == 4)
411
415
    *((grub_uint32_t *) curval->data)
412
416
      = PTR_TO_UINT32 (SYSTEM_TABLE_PTR (runtime_services));