Skip to content

Commit 229bd79

Browse files
kilroydlinvjw
authored andcommitted
orinoco: initialise priv->hw before assigning the interrupt
The interrupt handler takes a lock - but since commit bcad6e8 this lock goes through an indirection specified in the hermes_t structure. We must therefore initialise the structure before setting up the interrupt handler. Fix orinoco_cs and spectrum_cs <https://bugzilla.kernel.org/show_bug.cgi?id=23932> Bisected by: Matt Domsch <Matt_Domsch@dell.com> Signed-off by: David Kilroy <kilroyd@googlemail.com> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 884a963 commit 229bd79

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎drivers/net/wireless/orinoco/orinoco_cs.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,20 @@ orinoco_cs_config(struct pcmcia_device *link)
151151
goto failed;
152152
}
153153

154-
ret = pcmcia_request_irq(link, orinoco_interrupt);
155-
if (ret)
156-
goto failed;
157-
158-
/* We initialize the hermes structure before completing PCMCIA
159-
* configuration just in case the interrupt handler gets
160-
* called. */
161154
mem = ioport_map(link->resource[0]->start,
162155
resource_size(link->resource[0]));
163156
if (!mem)
164157
goto failed;
165158

159+
/* We initialize the hermes structure before completing PCMCIA
160+
* configuration just in case the interrupt handler gets
161+
* called. */
166162
hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
167163

164+
ret = pcmcia_request_irq(link, orinoco_interrupt);
165+
if (ret)
166+
goto failed;
167+
168168
ret = pcmcia_enable_device(link);
169169
if (ret)
170170
goto failed;

‎drivers/net/wireless/orinoco/spectrum_cs.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,21 @@ spectrum_cs_config(struct pcmcia_device *link)
214214
goto failed;
215215
}
216216

217-
ret = pcmcia_request_irq(link, orinoco_interrupt);
218-
if (ret)
219-
goto failed;
220-
221-
/* We initialize the hermes structure before completing PCMCIA
222-
* configuration just in case the interrupt handler gets
223-
* called. */
224217
mem = ioport_map(link->resource[0]->start,
225218
resource_size(link->resource[0]));
226219
if (!mem)
227220
goto failed;
228221

222+
/* We initialize the hermes structure before completing PCMCIA
223+
* configuration just in case the interrupt handler gets
224+
* called. */
229225
hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
230226
hw->eeprom_pda = true;
231227

228+
ret = pcmcia_request_irq(link, orinoco_interrupt);
229+
if (ret)
230+
goto failed;
231+
232232
ret = pcmcia_enable_device(link);
233233
if (ret)
234234
goto failed;

0 commit comments

Comments
 (0)