ti_icdi: add icdi_usb_query result check
[fw/openocd] / src / jtag / drivers / ti_icdi_usb.c
index dcffd2fba02e7f0d3aface879304d93edc78869b..997645199a2d0a81678b55204387d43b2a675933 100644 (file)
@@ -385,6 +385,8 @@ static int icdi_usb_query(void *handle)
 
        /* set extended mode */
        result = icdi_send_cmd(handle, "!");
+       if (result != ERROR_OK)
+               return result;
 
        /* check result */
        result = icdi_get_cmd_result(handle);