]> git.sur5r.net Git - openocd/commitdiff
jtag/drivers/ti_icdi: do not segfault when adapter can't be opened
authorPaul Fertser <fercerpav@gmail.com>
Fri, 24 Apr 2015 14:09:14 +0000 (17:09 +0300)
committerPaul Fertser <fercerpav@gmail.com>
Fri, 24 Apr 2015 15:08:18 +0000 (16:08 +0100)
Change-Id: Id3af8dfd18b13947bca4f3c89c2516ccbcef60b6
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2742
Tested-by: jenkins
src/jtag/drivers/ti_icdi_usb.c

index 53abbfb4305afc7ac8245a5638f0bff9359f0a9d..ac4566232193572e16f915121b3a2206064611db 100644 (file)
@@ -654,6 +654,9 @@ static int icdi_usb_close(void *handle)
 {
        struct icdi_usb_handle_s *h = handle;
 
+       if (!h)
+               return ERROR_OK;
+
        if (h->usb_dev)
                libusb_close(h->usb_dev);