sysclk-lwla: Fix a segfault in dev_close().

This commit is contained in:
Uwe Hermann 2017-12-24 15:24:35 +01:00
parent 56c8dd821e
commit 6c1a4cb44c
1 changed files with 2 additions and 1 deletions

View 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);