]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-09-22 Bean <bean123ch@gmail.com>
authorbean <bean@localhost>
Mon, 22 Sep 2008 03:49:26 +0000 (03:49 +0000)
committerbean <bean@localhost>
Mon, 22 Sep 2008 03:49:26 +0000 (03:49 +0000)
* disk/ata.c (grub_apapi_open): Initialize devfnd, no need to set
scsi->name and scsi->luns, as they will be set in grub_scsi_open.

* disk/scsi.c (grub_scsi_open): Don't call p->close (scsi) here when
error occurs, as grub_disk_open will call grub_disk_close, which will
call p->close (scsi).

ChangeLog
disk/ata.c
disk/scsi.c

index 734616b697455dc790adc6a8116b80b40cc56c9c..b4a0f767491ab74fe74920b8c195798b2b0be32e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-09-22  Bean  <bean123ch@gmail.com>
+
+       * disk/ata.c (grub_apapi_open): Initialize devfnd, no need to set
+       scsi->name and scsi->luns, as they will be set in grub_scsi_open.
+
+       * disk/scsi.c (grub_scsi_open): Don't call p->close (scsi) here when
+       error occurs, as grub_disk_open will call grub_disk_close, which will
+       call p->close (scsi).
+
 008-09-21  Felix Zielcke  <fzielcke@z-51.de>
 
        * configure.ac (AC_INIT): Quote `GRUB' string and version number.
index ab4a1da242f32c10c2be71cad517ab6ea645f05a..214a2cac7c3dacc511aca03bae0b10c9a1a96425 100644 (file)
@@ -891,7 +891,7 @@ static grub_err_t
 grub_atapi_open (const char *name, struct grub_scsi *scsi)
 {
   struct grub_ata_device *dev;
-  struct grub_ata_device *devfnd;
+  struct grub_ata_device *devfnd = 0;
 
   for (dev = grub_ata_devices; dev; dev = dev->next)
     {
@@ -911,8 +911,6 @@ grub_atapi_open (const char *name, struct grub_scsi *scsi)
     return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such ATAPI device");
 
   scsi->data = devfnd;
-  scsi->name = grub_strdup (name);
-  scsi->luns = 1;
 
   return GRUB_ERR_NONE;
 }
index aad59b5a3382afceba3b680028d768345a25e717..b7b6834e78fe7c833e1d7b39d6d7b9dc37926d03 100644 (file)
@@ -255,7 +255,6 @@ grub_scsi_open (const char *name, grub_disk_t disk)
          scsi->name = grub_strdup (name);
          if (! scsi->name)
            {
-             p->close (scsi);
              return grub_errno;
            }
 
@@ -265,7 +264,6 @@ grub_scsi_open (const char *name, grub_disk_t disk)
          if (err)
            {
              grub_dprintf ("scsi", "inquiry failed\n");
-             p->close (scsi);
              return grub_errno;
            }
 
@@ -277,7 +275,6 @@ grub_scsi_open (const char *name, grub_disk_t disk)
          if (scsi->devtype != grub_scsi_devtype_direct
              && scsi->devtype != grub_scsi_devtype_cdrom)
            {
-             p->close (scsi);
              return grub_error (GRUB_ERR_UNKNOWN_DEVICE,
                                 "unknown SCSI device");
            }
@@ -291,7 +288,6 @@ grub_scsi_open (const char *name, grub_disk_t disk)
          if (err)
            {
              grub_dprintf ("scsi", "READ CAPACITY failed\n");
-             p->close (scsi);
              return grub_errno;
            }