diff options
author | sanpei <sanpei@FreeBSD.org> | 2000-10-04 15:22:09 +0000 |
---|---|---|
committer | sanpei <sanpei@FreeBSD.org> | 2000-10-04 15:22:09 +0000 |
commit | 65239bc8b29cfd0bc50a1eed2c08e35729e1f055 (patch) | |
tree | a1bfe169f83dd6fba1db9a04df262ec54ae6eda5 | |
parent | 97127e89746f28e62205beb3967a8c39c64f4520 (diff) | |
download | FreeBSD-src-65239bc8b29cfd0bc50a1eed2c08e35729e1f055.zip FreeBSD-src-65239bc8b29cfd0bc50a1eed2c08e35729e1f055.tar.gz |
check {IO,IRQ}_ASSIGNED flags before
release {io,irq} resources.
fix multi io window in release io routine
PR: 20454
-rw-r--r-- | usr.sbin/pccard/pccardd/cardd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/pccard/pccardd/cardd.c b/usr.sbin/pccard/pccardd/cardd.c index 881cfe1..b6e4179 100644 --- a/usr.sbin/pccard/pccardd/cardd.c +++ b/usr.sbin/pccard/pccardd/cardd.c @@ -192,6 +192,7 @@ void card_removed(struct slot *sp) { struct card *cp; + struct allocblk *sio; int in_use = 0; if (sp->config && sp->config->driver && sp->card) @@ -210,10 +211,14 @@ card_removed(struct slot *sp) sp->cis = 0; sp->config = 0; /* release io */ - bit_nset(io_avail, sp->io.addr, sp->io.addr + sp->io.size - 1); + if (sp->flags & IO_ASSIGNED) + for (sio = &sp->io; sio; sio = sio->next) + if (sio->addr && sio->size) + bit_nset(io_avail, sio->addr, sio->addr + sio->size - 1); /* release irq */ - if (sp->irq) - pool_irq[sp->irq] = 1; + if (sp->flags & IRQ_ASSIGNED) + if (sp->irq >= 1 && sp->irq <= 15) + pool_irq[sp->irq] = 1; } /* CIS string comparison */ |