The DEVBLK was never being marked as in use and needing closing. Code did reset the dev->fd to -1 to indicate it was no longer in use, and checked it, but never actually set it. Since the fd isn't used for anything but this purpose, it'ss et to a nonsense positive value.
If a 3705 device is attached, detached, and attached again, Hercules crashes to desktop.
Reproduce:
The DEVBLK was never being marked as in use and needing closing. Code did reset the dev->fd to -1 to indicate it was no longer in use, and checked it, but never actually set it. Since the fd isn't used for anything but this purpose, it'ss et to a nonsense positive value.