Skip to content

Commit a2f5bfc

Browse files
hreineckejejb
authored andcommitted
[SCSI] aic7xxx: leaves timer running on init failure
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>
1 parent c59c614 commit a2f5bfc

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

‎drivers/scsi/aic7xxx/aic79xx_pci.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,12 @@ ahd_pci_config(struct ahd_softc *ahd, const struct ahd_pci_identity *entry)
377377
error = ahd_init(ahd);
378378
if (error != 0)
379379
return (error);
380+
ahd->init_level++;
380381

381382
/*
382383
* Allow interrupts now that we are completely setup.
383384
*/
384-
error = ahd_pci_map_int(ahd);
385-
if (!error)
386-
ahd->init_level++;
387-
return error;
385+
return ahd_pci_map_int(ahd);
388386
}
389387

390388
#ifdef CONFIG_PM

‎drivers/scsi/aic7xxx/aic7xxx_pci.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -960,16 +960,12 @@ ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry)
960960
error = ahc_init(ahc);
961961
if (error != 0)
962962
return (error);
963+
ahc->init_level++;
963964

964965
/*
965966
* Allow interrupts now that we are completely setup.
966967
*/
967-
error = ahc_pci_map_int(ahc);
968-
if (error != 0)
969-
return (error);
970-
971-
ahc->init_level++;
972-
return (0);
968+
return ahc_pci_map_int(ahc);
973969
}
974970

975971
/*

0 commit comments

Comments
 (0)