]> sigrok.org Git - libsigrok.git/commitdiff
sysclk-lwla: Close USB handle on drain error
authorDaniel Elstner <redacted>
Sat, 5 Dec 2015 09:41:16 +0000 (10:41 +0100)
committerDaniel Elstner <redacted>
Mon, 21 Dec 2015 16:56:52 +0000 (17:56 +0100)
src/hardware/sysclk-lwla/api.c

index 6ba18a28b76987b9123703da8d0b6eb9a42af773..891062560b0d5a09e86d5c24928a38dec6441ce3 100644 (file)
@@ -325,8 +325,10 @@ static int dev_open(struct sr_dev_inst *sdi)
        }
 
        ret = drain_usb(usb, EP_REPLY);
-       if (ret != SR_OK)
+       if (ret != SR_OK) {
+               sr_usb_close(usb);
                return ret;
+       }
 
        sdi->status = SR_ST_ACTIVE;