When a drive or RAID volume was removed or deleted while host I/O was
actively in progress, the driver polled for pending completions only
once. If outstanding requests had not completed within that single poll,
the driver proceeded to remove and free the target structure. When those
in-flight I/Os subsequently completed, dereferencing the stale target
pointer resulted in a use-after-free condition.
Drain pending I/Os cleanly before completing device removal by waiting
up to two seconds while repeatedly polling for completions. In the I/O
completion path, safely look up the target from the active list and guard
all dereferences with null checks rather than accessing the freed pointer
directly.