1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-23 04:54:26 +00:00

usb_cleanup() use correct locking mechanism

This commit is contained in:
Kano 2013-03-04 10:16:44 +11:00
parent e35e8ae135
commit aed1e516db

View File

@ -1524,17 +1524,18 @@ int _usb_transfer(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRequest
void usb_cleanup() void usb_cleanup()
{ {
struct cgpu_info *cgpu;
int i; int i;
mutex_lock(&devices_lock);
for (i = 0; i < total_devices; i++) { for (i = 0; i < total_devices; i++) {
switch (devices[i]->drv->drv_id) { cgpu = get_devices(i);
switch (cgpu->drv->drv_id) {
case DRIVER_BITFORCE: case DRIVER_BITFORCE:
case DRIVER_MODMINER: case DRIVER_MODMINER:
release_cgpu(devices[i]); release_cgpu(cgpu);
break;
default: default:
break; break;
} }
} }
mutex_unlock(&devices_lock);
} }