From: Bert Vermeulen Date: Sat, 14 Jul 2012 14:14:01 +0000 (+0200) Subject: asix-sigma: don't attempt to free static struct X-Git-Tag: dsupstream~809 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=eec944c5b8e4885e61faf3ab318be6007f221fd9;p=libsigrok.git asix-sigma: don't attempt to free static struct Added more debugging as well. --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 3bf6e847..84066c44 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -447,6 +447,7 @@ static GSList *hw_scan(GSList *options) struct ftdi_device_list *devlist; char serial_txt[10]; uint32_t serial; + int ret; (void)options; devices = NULL; @@ -461,9 +462,12 @@ static GSList *hw_scan(GSList *options) /* Look for SIGMAs. */ - if (ftdi_usb_find_all(&ctx->ftdic, &devlist, - USB_VENDOR, USB_PRODUCT) <= 0) + if ((ret = ftdi_usb_find_all(&ctx->ftdic, &devlist, + USB_VENDOR, USB_PRODUCT)) <= 0) { + if (ret < 0) + sr_err("ftdi_usb_find_all(): %d", ret); goto free; + } /* Make sure it's a version 1 or 2 SIGMA. */ ftdi_usb_get_strings(&ctx->ftdic, devlist->dev, NULL, 0, NULL, 0, @@ -503,7 +507,7 @@ static GSList *hw_scan(GSList *options) return devices; free: - ftdi_free(&ctx->ftdic); + ftdi_deinit(&ctx->ftdic); g_free(ctx); return NULL; }