]> sigrok.org Git - libsigrok.git/commitdiff
sysclk-lwla: Fix a segfault in dev_close().
authorUwe Hermann <redacted>
Sun, 24 Dec 2017 14:24:35 +0000 (15:24 +0100)
committerUwe Hermann <redacted>
Sun, 24 Dec 2017 14:24:35 +0000 (15:24 +0100)
src/hardware/sysclk-lwla/api.c

index 93e54895e08ffd8352e7342f772e552fecd3df4d..c6be15edbb952500fe882a618009907bf49437c4 100644 (file)
@@ -301,7 +301,8 @@ static int dev_close(struct sr_dev_inst *sdi)
        if (ret != SR_OK)
                sr_warn("Unable to shut down device.");
 
-       libusb_release_interface(usb->devhdl, USB_INTERFACE);
+       if (usb->devhdl)
+               libusb_release_interface(usb->devhdl, USB_INTERFACE);
 
        sr_usb_close(usb);