Fix a race between setting up the interrupt handler and it firing by

setting the data prior to setting up the interrupt. Now we only set
the cookie afterwards, and that (a) cannot be helpd and (b) isn't used
in the ISR.

PR: 147127
Submitted by: hps@
This commit is contained in:
imp 2019-01-07 06:19:51 +00:00
parent b542ac1ea9
commit eef000151a

View File

@ -1272,13 +1272,16 @@ pccard_setup_intr(device_t dev, device_t child, struct resource *irq,
if (pf->intr_filter != NULL || pf->intr_handler != NULL)
panic("Only one interrupt handler per function allowed");
err = bus_generic_setup_intr(dev, child, irq, flags, pccard_filter,
intr ? pccard_intr : NULL, pf, cookiep);
if (err != 0)
return (err);
pf->intr_filter = filt;
pf->intr_handler = intr;
pf->intr_handler_arg = arg;
err = bus_generic_setup_intr(dev, child, irq, flags, pccard_filter,
intr ? pccard_intr : NULL, pf, cookiep);
if (err != 0) {
pf->intr_filter = NULL;
pf->intr_handler = NULL;
return (err);
}
pf->intr_handler_cookie = *cookiep;
if (pccard_mfc(sc)) {
pccard_ccr_write(pf, PCCARD_CCR_OPTION,