]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/aic7xxx-leaves-timer-running-on-init-failure
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / aic7xxx-leaves-timer-running-on-init-failure
CommitLineData
2cb7cef9
BS
1From: Hannes Reinecke <hare@suse.de>
2Date: Wed, 25 Mar 2009 11:18:16 +0100
3Subject: aic7xxx leaves timer running on init failure
4References: bnc#469576
5
6aic79xx leaves timers inserted when ahd_init() (which inserts
7two timers at its very end) succeeds but ahd_pci_map_int()
8fails. In this case ahd->init_level gets incremented to 5 only
9when that function succeeds, but ahd_free() calls ahd_shutdown()
10only when ahd->init_level == 5, and ahd_shutdown() is where the
11timers get removed. Since the freeing of the IRQ is not controlled
12by ahd->init_level, we should increment init_level prior to
13calling ahd_pci_map_int().
14
15Reported-by: Jan Beulich <jbeulich@novell.com>
16Signed-off-by: Hannes Reinecke <hare@suse.de>
17---
18 drivers/scsi/aic7xxx/aic79xx_pci.c | 6 ++----
19 drivers/scsi/aic7xxx/aic7xxx_pci.c | 8 ++------
20 2 files changed, 4 insertions(+), 10 deletions(-)
21
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);
26 if (error != 0)
27 return (error);
28+ ahd->init_level++;
29
30 /*
31 * Allow interrupts now that we are completely setup.
32 */
33- error = ahd_pci_map_int(ahd);
34- if (!error)
35- ahd->init_level++;
36- return error;
37+ return ahd_pci_map_int(ahd);
38 }
39
40 #ifdef CONFIG_PM
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);
45 if (error != 0)
46 return (error);
47+ ahc->init_level++;
48
49 /*
50 * Allow interrupts now that we are completely setup.
51 */
52- error = ahc_pci_map_int(ahc);
53- if (error != 0)
54- return (error);
55-
56- ahc->init_level++;
57- return (0);
58+ return ahc_pci_map_int(ahc);
59 }
60
61 /*