Sean Young wrote:
> @@ -321,21 +335,25 @@ static int logic16_dev_open(struct sr_dev_inst *sdi)
>       }
>       libusb_free_device_list(devlist, 1);
>  
> -     if (sdi->status != SR_ST_ACTIVE)
> +     if (sdi->status != SR_ST_ACTIVE) {
> +             if (usb->devhdl) {
> +                     libusb_release_interface(usb->devhdl, USB_INTERFACE);
> +                     libusb_close(usb->devhdl);
> +                     usb->devhdl = NULL;
> +             }
>               return SR_ERR;
> +     }
>  
>       return SR_OK;
>  }

Are you sure that this is really correct? I'm not, but I don't know
the relevant code on the other hand.

libusb_release_interface() must be called 1:1 with
libusb_claim_interface(), just like libusb_close() must be called 1:1
with libusb_open(). The sdi->status != SR_ST_ACTIVE isn't obviously
a good way to determine whether a _claim() was successful?


//Peter

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to