]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fs/hfs/hfs_open: Check that mount succeeded.
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 25 Jan 2015 00:28:17 +0000 (01:28 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 25 Jan 2015 00:28:17 +0000 (01:28 +0100)
Found by: Coverity scan.

grub-core/fs/hfs.c

index f46f77a945d164bf9d0e8e4207c40dc2755aa8f4..ab472f4b02091078f7507a837bdfdfc01a52b765 100644 (file)
@@ -1306,6 +1306,12 @@ grub_hfs_open (struct grub_file *file, const char *name)
 
   data = grub_hfs_mount (file->device->disk);
 
+  if (!data)
+    {
+      grub_dl_unref (my_mod);
+      return grub_errno;
+    }
+
   if (grub_hfs_find_dir (data, name, &frec, 0))
     {
       grub_free (data);