Change the management of commands in the active commands TAILQ to let issuers
authormiod <miod@openbsd.org>
Thu, 5 Aug 2010 13:50:00 +0000 (13:50 +0000)
committermiod <miod@openbsd.org>
Thu, 5 Aug 2010 13:50:00 +0000 (13:50 +0000)
commit6cd90e55325bf8df342486bb775f37a382ce362f
tree8246edf519ca4b694ea75ba2ef4aabfac0fbcbbf
parent2934a9b8d9db4222e81a6b07bc058f24eb3589cf
Change the management of commands in the active commands TAILQ to let issuers
of synchronous commands perform the TAILQ_REMOVE of the command themselves,
instead of relying upon this being done for us if tsleep() returns zero.

Since we momentarily set `cold' again around suspend, tsleep() becomes a
no-op, which broke this assumption, and in turn caused TAILQ corruption,
with items being put on the freelist while still on the active list.

Found the hard way by ray@ playing with wsmoused after resume.
sys/dev/ic/pckbc.c