Browse Source

tidy up free in device detect functions

nfactor-troky
Kano 12 years ago
parent
commit
749fa78d8a
  1. 4
      driver-avalon.c
  2. 10
      driver-bflsc.c
  3. 8
      driver-bitforce.c
  4. 1
      driver-icarus.c
  5. 6
      driver-modminer.c

4
driver-avalon.c

@ -653,11 +653,11 @@ unshin: @@ -653,11 +653,11 @@ unshin:
shin:
if (avalon->device_data)
free(avalon->device_data);
avalon->device_data = NULL;
if (avalon->device_path)
free(avalon->device_path);
avalon->device_path = NULL;
avalon = usb_free_cgpu(avalon);

10
driver-bflsc.c

@ -966,13 +966,15 @@ unshin: @@ -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);

8
driver-bitforce.c

@ -287,12 +287,12 @@ unshin: @@ -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);

1
driver-icarus.c

@ -843,6 +843,7 @@ unshin: @@ -843,6 +843,7 @@ unshin:
usb_uninit(icarus);
free(icarus->device_path);
icarus->device_path = NULL;
shin:

6
driver-modminer.c

@ -210,6 +210,7 @@ static bool modminer_detect_one(struct libusb_device *dev, struct usb_find_devic @@ -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: @@ -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) @@ -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…
Cancel
Save