]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
commands/nativedisk: Add missing device_close.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 20:18:36 +0000 (21:18 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 24 Jan 2015 20:18:36 +0000 (21:18 +0100)
Found by: Coverity scan.

grub-core/commands/nativedisk.c

index 33b6b99eaaf4b204179e1b8114c3f5237cf27fa9..b3bc4639cb7b334ea456902f2a1d1afab42537d5 100644 (file)
@@ -57,6 +57,7 @@ get_uuid (const char *name, char **uuid, int getnative)
   if (!dev->disk)
     {
       grub_dprintf ("nativedisk", "Skipping non-disk\n");
+      grub_device_close (dev);
       return 0;
     }
 
@@ -90,6 +91,7 @@ get_uuid (const char *name, char **uuid, int getnative)
     case GRUB_DISK_DEVICE_MEMDISK_ID:
       grub_dprintf ("nativedisk", "Skipping native disk %s\n",
                    dev->disk->name);
+      grub_device_close (dev);
       return 0;
 
       /* FIXME: those probably need special handling.  */