X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Fsaleae-logic16%2Fapi.c;h=ff0af73532dbd09389bdd776ac1e03970e87b8ce;hp=cfddfbb082d0fb990596f6af627f4eb768e60ae3;hb=f1ba6b4b2c9a8ecf90bb31efb218752aa7e49d1a;hpb=7e463623382e1f574fde150b3fc88a65eaebb578 diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c index cfddfbb0..ff0af735 100644 --- a/src/hardware/saleae-logic16/api.c +++ b/src/hardware/saleae-logic16/api.c @@ -379,15 +379,15 @@ static int dev_close(struct sr_dev_inst *sdi) struct sr_usb_dev_inst *usb; usb = sdi->conn; + if (!usb->devhdl) - return SR_ERR; + return SR_ERR_BUG; sr_info("Closing device on %d.%d (logical) / %s (physical) interface %d.", usb->bus, usb->address, sdi->connection_id, USB_INTERFACE); libusb_release_interface(usb->devhdl, USB_INTERFACE); libusb_close(usb->devhdl); usb->devhdl = NULL; - sdi->status = SR_ST_INACTIVE; return SR_OK; }