Fix unitialized use of cur_speed in handle_jtag_khz_command:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 12 Jun 2009 01:41:07 +0000 (01:41 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 12 Jun 2009 01:41:07 +0000 (01:41 +0000)
- Use the default KHz speed setting, in case interface is not initialized.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2218 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/tcl.c

index 5fc1bce21c264acc22c1dd80705ca30ece854ca5..152dd762f5a628a719189ed8a50f50a46c644e08 100644 (file)
@@ -1038,7 +1038,7 @@ static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd,
                        return retval;
        }
 
-       int cur_speed;
+       int cur_speed = jtag_get_speed_khz();
        retval = jtag_get_speed_readable(&cur_speed);
        if (ERROR_OK != retval)
                return retval;