Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24.4 /drivers/scsi/ips.c

Filename:/drivers/scsi/ips.c
Lines Added:14
Lines Deleted:6
Also changed in: (Previous) 2.6.24.4-rc3  2.6.24.4-rc2  2.6.24.4-rc1  2.6.24-git22  2.6.24-git21  2.6.24-git20 
(Following) 2.6.24.5  2.6.24.6  2.6.24.7  2.6.25-rc7  2.6.25-rc8  2.6.25-rc9 

Location
[  2.6.24.4
  [  drivers
    [  scsi
       o  ips.c

Patch

diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 5c5a9b2..f4e9c8d 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -1580,7 +1580,7 @@ ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr)
    METHOD_TRACE("ips_make_passthru", 1);
 
         scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i)
-                length += sg[i].length;
+      length += sg->length;
 
    if (length < sizeof (ips_passthru_t)) {
       /* wrong size */
@@ -6842,13 +6842,10 @@ ips_register_scsi(int index)
    if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
       IPS_PRINTK(KERN_WARNING, ha->pcidev,
             "Unable to install interrupt handler\n");
-      scsi_host_put(sh);
-      return -1;
+      goto err_out_sh;
    }
 
    kfree(oldha);
-   ips_sh[index] = sh;
-   ips_ha[index] = ha;
 
    /* Store away needed values for later use */
    sh->io_port = ha->io_addr;
@@ -6867,10 +6864,21 @@ ips_register_scsi(int index)
    sh->max_channel = ha->nbus - 1;
    sh->can_queue = ha->max_cmds - 1;
 
-   scsi_add_host(sh, NULL);
+   if (scsi_add_host(sh, &ha->pcidev->dev))
+      goto err_out;
+
+   ips_sh[index] = sh;
+   ips_ha[index] = ha;
+
    scsi_scan_host(sh);
 
    return 0;
+
+err_out:
+   free_irq(ha->pcidev->irq, ha);
+err_out_sh:
+   scsi_host_put(sh);
+   return -1;
 }
 
 /*---------------------------------------------------------------------------*/


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.