diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 88668c20..92355bc5 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -2,6 +2,14 @@ * src/bus/s3c4510x.c: Punt dead/useless cvs log info. + * src/tap/cable.c (urj_tap_cable_create): Call urj_bus_buses_delete() rather + than manipulate urj_bus directly so the urj_buses structure doesn't get + corrupted. Otherwise we segfault when changing cables after initializing a + bus: cable probe; detect; initbus ...; detectflash ...; cable probe; detect + * src/apps/jtag/jtag.c (cleanup): Call urj_bus_buses_free() to clean up all + buses and not just the active one. + http://blackfin.uclinux.org/gf/tracker/6028 + 2010-06-14 Mike Frysinger * configure.ac: Drop stropts.h check since parport code no longer uses it. diff --git a/urjtag/src/apps/jtag/jtag.c b/urjtag/src/apps/jtag/jtag.c index 3a00016f..d8823d6f 100644 --- a/urjtag/src/apps/jtag/jtag.c +++ b/urjtag/src/apps/jtag/jtag.c @@ -339,12 +339,7 @@ static void cleanup (urj_chain_t *chain) { urj_flash_cleanup (); - - if (urj_bus) - { - URJ_BUS_FREE (urj_bus); - urj_bus = NULL; - } + urj_bus_buses_free (); urj_tap_chain_free (chain); chain = NULL; } diff --git a/urjtag/src/tap/cable.c b/urjtag/src/tap/cable.c index de4d1e78..2d9854dc 100644 --- a/urjtag/src/tap/cable.c +++ b/urjtag/src/tap/cable.c @@ -539,10 +539,7 @@ urj_tap_cable_create (urj_chain_t *chain, const urj_cable_driver_t *driver) urj_cable_t *cable; if (urj_bus) - { - URJ_BUS_FREE (urj_bus); - urj_bus = NULL; - } + urj_bus_buses_delete (urj_bus); urj_tap_chain_disconnect (chain);