1 From: Hannes Reinecke <hare@suse.de>
2 Date: Wed, 25 Mar 2009 11:18:16 +0100
3 Subject: aic7xxx leaves timer running on init failure
6 aic79xx leaves timers inserted when ahd_init() (which inserts
7 two timers at its very end) succeeds but ahd_pci_map_int()
8 fails. In this case ahd->init_level gets incremented to 5 only
9 when that function succeeds, but ahd_free() calls ahd_shutdown()
10 only when ahd->init_level == 5, and ahd_shutdown() is where the
11 timers get removed. Since the freeing of the IRQ is not controlled
12 by ahd->init_level, we should increment init_level prior to
13 calling ahd_pci_map_int().
15 Reported-by: Jan Beulich <jbeulich@novell.com>
16 Signed-off-by: Hannes Reinecke <hare@suse.de>
18 drivers/scsi/aic7xxx/aic79xx_pci.c | 6 ++----
19 drivers/scsi/aic7xxx/aic7xxx_pci.c | 8 ++------
20 2 files changed, 4 insertions(+), 10 deletions(-)
22 --- a/drivers/scsi/aic7xxx/aic79xx_pci.c
23 +++ b/drivers/scsi/aic7xxx/aic79xx_pci.c
24 @@ -379,14 +379,12 @@ ahd_pci_config(struct ahd_softc *ahd, co
25 error = ahd_init(ahd);
31 * Allow interrupts now that we are completely setup.
33 - error = ahd_pci_map_int(ahd);
37 + return ahd_pci_map_int(ahd);
41 --- a/drivers/scsi/aic7xxx/aic7xxx_pci.c
42 +++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c
43 @@ -960,16 +960,12 @@ ahc_pci_config(struct ahc_softc *ahc, co
44 error = ahc_init(ahc);
50 * Allow interrupts now that we are completely setup.
52 - error = ahc_pci_map_int(ahc);
58 + return ahc_pci_map_int(ahc);