mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-14 00:38:02 +00:00
tidy up free in device detect functions
This commit is contained in:
parent
9287ee90f6
commit
749fa78d8a
@ -653,11 +653,11 @@ unshin:
|
||||
|
||||
shin:
|
||||
|
||||
if (avalon->device_data)
|
||||
free(avalon->device_data);
|
||||
free(avalon->device_data);
|
||||
avalon->device_data = NULL;
|
||||
|
||||
if (avalon->device_path)
|
||||
free(avalon->device_path);
|
||||
free(avalon->device_path);
|
||||
avalon->device_path = NULL;
|
||||
|
||||
avalon = usb_free_cgpu(avalon);
|
||||
|
||||
|
@ -966,13 +966,15 @@ unshin:
|
||||
shin:
|
||||
|
||||
free(bflsc->device_path);
|
||||
bflsc->device_path = NULL;
|
||||
|
||||
free(bflsc->device_data);
|
||||
bflsc->device_data = NULL;
|
||||
|
||||
if (bflsc->name != blank)
|
||||
if (bflsc->name != blank) {
|
||||
free(bflsc->name);
|
||||
|
||||
if (bflsc->drv->copy)
|
||||
free(bflsc->drv);
|
||||
bflsc->name = NULL;
|
||||
}
|
||||
|
||||
bflsc = usb_free_cgpu(bflsc);
|
||||
|
||||
|
@ -287,12 +287,12 @@ unshin:
|
||||
shin:
|
||||
|
||||
free(bitforce->device_path);
|
||||
bitforce->device_path = NULL;
|
||||
|
||||
if (bitforce->name != blank)
|
||||
if (bitforce->name != blank) {
|
||||
free(bitforce->name);
|
||||
|
||||
if (bitforce->drv->copy)
|
||||
free(bitforce->drv);
|
||||
bitforce->name = NULL;
|
||||
}
|
||||
|
||||
bitforce = usb_free_cgpu(bitforce);
|
||||
|
||||
|
@ -843,6 +843,7 @@ unshin:
|
||||
usb_uninit(icarus);
|
||||
|
||||
free(icarus->device_path);
|
||||
icarus->device_path = NULL;
|
||||
|
||||
shin:
|
||||
|
||||
|
@ -210,6 +210,7 @@ static bool modminer_detect_one(struct libusb_device *dev, struct usb_find_devic
|
||||
|
||||
if (!add_cgpu(tmp)) {
|
||||
free(tmp->device_path);
|
||||
tmp->device_path = NULL;
|
||||
tmp = usb_free_cgpu(tmp);
|
||||
goto unshin;
|
||||
}
|
||||
@ -228,8 +229,10 @@ unshin:
|
||||
usb_uninit(modminer);
|
||||
|
||||
shin:
|
||||
if (!added)
|
||||
if (!added) {
|
||||
free(modminer->modminer_mutex);
|
||||
modminer->modminer_mutex = NULL;
|
||||
}
|
||||
|
||||
modminer = usb_free_cgpu(modminer);
|
||||
|
||||
@ -1096,6 +1099,7 @@ static void modminer_hw_error(struct thr_info *thr)
|
||||
static void modminer_fpga_shutdown(struct thr_info *thr)
|
||||
{
|
||||
free(thr->cgpu_data);
|
||||
thr->cgpu_data = NULL;
|
||||
}
|
||||
|
||||
static char *modminer_set_device(struct cgpu_info *modminer, char *option, char *setting, char *replybuf)
|
||||
|
Loading…
Reference in New Issue
Block a user