]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
efiemu: check return value of grub_efiemu_write_value
authorAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 9 Jan 2016 08:05:33 +0000 (11:05 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Sat, 9 Jan 2016 08:36:42 +0000 (11:36 +0300)
Found by: Coverity scan.
CID: 73590

grub-core/efiemu/prepare.c

index 84c3368a82c4db0f9afc5347c73d5744c8c42a5d..99ddb5abbdecacd3d147823f4191e6e5bcf942ff 100644 (file)
@@ -83,10 +83,16 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks,
     ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off);
 
   /* Put pointer to the list of configuration tables in system table */
-  grub_efiemu_write_value
-    (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0,
-     conftable_handle, 0, 1,
-     sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table));
+  err = grub_efiemu_write_value
+       (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0,
+        conftable_handle, 0, 1,
+        sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table));
+  if (err)
+    {
+      grub_efiemu_unload ();
+      return err;
+    }
+
   SUFFIX(grub_efiemu_system_table)->num_table_entries = cntconftables;
 
   /* Fill the list of configuration tables */