diff --git a/jtag/ChangeLog b/jtag/ChangeLog index d8e39a39..f11ee3f2 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -2,9 +2,9 @@ * src/cmd/cable.c, src/tap/cable/wiggler.c, src/tap/cable/generic_usbconn.c, src/tap/cable/vision_ep9307.c, - src/tap/cable/jim.c, src/tap/cable/ft2232.c, - src/tap/cable/generic_parport.c: Cable connect/disconnect cleanup, - fix malloc/free issues (Hartley Sweeten) + src/tap/cable/jim.c, src/tap/cable/ft2232.c, + src/tap/cable/usbblaster.c, src/tap/cable/generic_parport.c: Cable + connect/disconnect cleanup, fix malloc/free issues (Hartley Sweeten) 2008-05-27 Arnim Laeuger diff --git a/jtag/src/tap/cable/usbblaster.c b/jtag/src/tap/cable/usbblaster.c index 4c98343d..03006acf 100644 --- a/jtag/src/tap/cable/usbblaster.c +++ b/jtag/src/tap/cable/usbblaster.c @@ -67,26 +67,24 @@ usbblaster_connect( char *params[], cable_t *cable ) params_t *cable_params; int result; + /* perform generic_usbconn_connect */ + if ( ( result = generic_usbconn_connect( params, cable ) ) != 0 ) + return result; + cable_params = (params_t *)malloc( sizeof(params_t) ); if (!cable_params) { - free( cable ); + printf( _("%s(%d) malloc failed!\n"), __FILE__, __LINE__); return 4; } - /* perform generic_usbconn_connect */ - result = generic_usbconn_connect( params, cable ); + cx_cmd_init( &(cable_params->cmd_root) ); - if (result == 0) - { - cx_cmd_init( &(cable_params->cmd_root) ); + /* exchange generic cable parameters with our private parameter set */ + free( cable->params ); + cable->params = cable_params; - /* exchange generic cable parameters with our private parameter set */ - free( cable->params ); - cable->params = cable_params; - } - - return result; + return 0; } static int