From: Uwe Hermann Date: Sun, 24 Dec 2017 14:24:35 +0000 (+0100) Subject: sysclk-lwla: Fix a segfault in dev_close(). X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6c1a4cb44ccd24b2b23477c86273a8e405758c03;p=libsigrok.git sysclk-lwla: Fix a segfault in dev_close(). --- diff --git a/src/hardware/sysclk-lwla/api.c b/src/hardware/sysclk-lwla/api.c index 93e54895..c6be15ed 100644 --- a/src/hardware/sysclk-lwla/api.c +++ b/src/hardware/sysclk-lwla/api.c @@ -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);