]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/partmap/gpt.c (gpt_partition_map_embed): Restore
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 12 Nov 2011 23:01:06 +0000 (00:01 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 12 Nov 2011 23:01:06 +0000 (00:01 +0100)
disk->partiton for safety.

ChangeLog
grub-core/partmap/gpt.c

index 230eb0cec2c1c8c1ede9337d7c6d19c862d2202c..95aed126c29043095b67b048c8e4659104ad3cdd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-12  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/partmap/gpt.c (gpt_partition_map_embed): Restore
+       disk->partiton for safety.
+
 2011-11-12  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev):
index 73a1c3b195d35d4dbacc80f4fad8a6b7d806b919..c8bc52609c6429f6f2a7327cdcdf57f769133db6 100644 (file)
@@ -140,11 +140,17 @@ gpt_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
                                           const grub_partition_t p)
   {
     struct grub_gpt_partentry gptdata;
+    grub_partition_t p2;
 
+    p2 = disk->partition;
     disk->partition = p->parent;
     if (grub_disk_read (disk, p->offset, p->index,
                        sizeof (gptdata), &gptdata))
-      return 0;
+      {
+       disk->partition = p2;
+       return 0;
+      }
+    disk->partition = p2;
 
     /* If there's an embed region, it is in a dedicated partition.  */
     if (! grub_memcmp (&gptdata.type, &grub_gpt_partition_type_bios_boot, 16))