fx2lafw: Added more to hw_cleanup
This commit is contained in:
parent
f1898235e8
commit
62bc70e412
|
@ -390,20 +390,36 @@ static int hw_cleanup(void)
|
||||||
{
|
{
|
||||||
GSList *l;
|
GSList *l;
|
||||||
struct sr_dev_inst *sdi;
|
struct sr_dev_inst *sdi;
|
||||||
|
struct fx2lafw_device *ctx;
|
||||||
|
int ret = SR_OK;
|
||||||
|
|
||||||
for(l = device_instances; l; l = l->next) {
|
for(l = dev_insts; l; l = l->next) {
|
||||||
|
if (!(sdi = l->data)) {
|
||||||
|
/* Log error, but continue cleaning up the rest. */
|
||||||
|
sr_err("fx2lafw: %s: sdi was NULL, continuing", __func__);
|
||||||
|
ret = SR_ERR_BUG;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!(ctx = sdi->priv)) {
|
||||||
|
/* Log error, but continue cleaning up the rest. */
|
||||||
|
sr_err("fx2lafw: %s: sdi->priv was NULL, continuing",
|
||||||
|
__func__);
|
||||||
|
ret = SR_ERR_BUG;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
close_dev(sdi);
|
||||||
sdi = l->data;
|
sdi = l->data;
|
||||||
sr_dev_inst_free(sdi);
|
sr_dev_inst_free(sdi);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_slist_free(device_instances);
|
g_slist_free(dev_insts);
|
||||||
device_instances = NULL;
|
dev_insts = NULL;
|
||||||
|
|
||||||
if(usb_context)
|
if(usb_context)
|
||||||
libusb_exit(usb_context);
|
libusb_exit(usb_context);
|
||||||
usb_context = NULL;
|
usb_context = NULL;
|
||||||
|
|
||||||
return SR_OK;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *hw_dev_info_get(int device_index, int device_info_id)
|
static void *hw_dev_info_get(int device_index, int device_info_id)
|
||||||
|
|
Loading…
Reference in New Issue