Laurentiu Cocanu - memory read/write and exit() error path fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1064 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -410,7 +410,7 @@ int ft2232_send_and_recv(jtag_command_t *first, jtag_command_t *last)
|
||||
if ((retval = ft2232_write(ft2232_buffer, ft2232_buffer_size, &bytes_written)) != ERROR_OK)
|
||||
{
|
||||
LOG_ERROR("couldn't write MPSSE commands to FT2232");
|
||||
exit(-1);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG_USB_IO_
|
||||
@@ -429,7 +429,7 @@ int ft2232_send_and_recv(jtag_command_t *first, jtag_command_t *last)
|
||||
if ((retval = ft2232_read(ft2232_buffer, ft2232_expect_read, &bytes_read)) != ERROR_OK)
|
||||
{
|
||||
LOG_ERROR("couldn't read from FT2232");
|
||||
exit(-1);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG_USB_IO_
|
||||
|
||||
@@ -1720,6 +1720,7 @@ static int default_speed_div(int speed, int *khz)
|
||||
int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
int i;
|
||||
int retval;
|
||||
|
||||
/* check whether the interface is already configured */
|
||||
if (jtag_interface)
|
||||
@@ -1738,8 +1739,10 @@ int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char
|
||||
{
|
||||
if (strcmp(args[0], jtag_interfaces[i]->name) == 0)
|
||||
{
|
||||
if (jtag_interfaces[i]->register_commands(cmd_ctx) != ERROR_OK)
|
||||
exit(-1);
|
||||
if ((retval = jtag_interfaces[i]->register_commands(cmd_ctx)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
jtag_interface = jtag_interfaces[i];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user