[SCSI] aic7xxx: leaves timer running on init failure
authorHannes Reinecke <hare@suse.de>
Wed, 25 Mar 2009 10:19:37 +0000 (11:19 +0100)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 3 Apr 2009 14:22:55 +0000 (09:22 -0500)
aic79xx leaves timers inserted when ahd_init() (which inserts
two timers at its very end) succeeds but ahd_pci_map_int()
fails. In this case ahd->init_level gets incremented to 5 only
when that function succeeds, but ahd_free() calls ahd_shutdown()
only when ahd->init_level == 5, and ahd_shutdown() is where the
timers get removed. Since the freeing of the IRQ is not controlled
by ahd->init_level, we should increment init_level prior to
calling ahd_pci_map_int().

Reported-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/aic7xxx/aic79xx_pci.c
drivers/scsi/aic7xxx/aic7xxx_pci.c

index a734d77e880efb2430795442d2e3e4c719259946..b8423c428a146432f2a2e173ccc3a0b0a90b540a 100644 (file)
@@ -377,14 +377,12 @@ ahd_pci_config(struct ahd_softc *ahd, const struct ahd_pci_identity *entry)
        error = ahd_init(ahd);
        if (error != 0)
                return (error);
+       ahd->init_level++;
 
        /*
         * Allow interrupts now that we are completely setup.
         */
-       error = ahd_pci_map_int(ahd);
-       if (!error)
-               ahd->init_level++;
-       return error;
+       return ahd_pci_map_int(ahd);
 }
 
 #ifdef CONFIG_PM
index c07cb6eebb0294cac8ae9e93820e14562719c9fd..4347c8dc459f3a0b60e6d9f0143d9eb79004a4ec 100644 (file)
@@ -960,16 +960,12 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry)
        error = ahc_init(ahc);
        if (error != 0)
                return (error);
+       ahc->init_level++;
 
        /*
         * Allow interrupts now that we are completely setup.
         */
-       error = ahc_pci_map_int(ahc);
-       if (error != 0)
-               return (error);
-
-       ahc->init_level++;
-       return (0);
+       return ahc_pci_map_int(ahc);
 }
 
 /*
This page took 0.030663 seconds and 5 git commands to generate.