Null a device driver should thread prepare fail.
diff --git a/cgminer.c b/cgminer.c
index 76d586b..16e1b68 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -8402,6 +8402,7 @@ static void hotplug_process(void)
thr->device_thread = j;
if (cgpu->drv->thread_prepare && !cgpu->drv->thread_prepare(thr)) {
+ null_device_drv(cgpu->drv);
cgpu->deven = DEV_DISABLED;
continue;
}