During driver reload stress test, after 50-300 reloads occurs panic.
Adding sleeps after load/unload driver issue does not occur.
Too fast load/unload may cause that gt_taskqueue pointer is freed earlier.
Checking null pointer for this fixes it.
Script used to test it:
i=1 while true do echo "Attempt number $i" echo "Loading if_ice" kldload if_ice echo "Unloading if_ice" kldunload if_ice i=$(expr $i + 1) echo "Last good try: $i" > ice_load_unload_lastGoodTry.txt done