From 5acab844050150213b058f76a2ed3ec332ffc02c Mon Sep 17 00:00:00 2001 From: Aki Van Ness Date: Sat, 16 Sep 2023 14:24:23 -0700 Subject: [PATCH 1/2] hosted/bmp_libusb: Fixed a small memory leak in the FTDI failure path of `find_debuggers` --- src/platforms/hosted/bmp_libusb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platforms/hosted/bmp_libusb.c b/src/platforms/hosted/bmp_libusb.c index 0d70b13773d..6c04a1f3924 100644 --- a/src/platforms/hosted/bmp_libusb.c +++ b/src/platforms/hosted/bmp_libusb.c @@ -549,6 +549,7 @@ int find_debuggers(bmda_cli_options_s *cl_opts, bmda_probe_s *info) // Don't know the cable type, ask user to specify with "-c" DEBUG_WARN("Multiple FTDI adapters match Vendor and Product ID.\n"); DEBUG_WARN("Please specify adapter type on command line using \"-c\" option.\n"); + probe_info_list_free(probe_list); return -1; //false } /* If the selected probe is CMSIS-DAP, check for v2 interfaces */ From d28daf31acbb45af5c358bd323f9748c4763549e Mon Sep 17 00:00:00 2001 From: Aki Van Ness Date: Sat, 16 Sep 2023 14:26:04 -0700 Subject: [PATCH 2/2] hosted/ftdi_bmp: Fixed a bug in `ftdi_lookup_cable_by_product` resulting in a lookup failure if the cable type was specified on the command line --- src/platforms/hosted/ftdi_bmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/hosted/ftdi_bmp.c b/src/platforms/hosted/ftdi_bmp.c index 6cbab602a18..3a9f6ec5d23 100644 --- a/src/platforms/hosted/ftdi_bmp.c +++ b/src/platforms/hosted/ftdi_bmp.c @@ -412,7 +412,7 @@ bool ftdi_lookup_adapter_from_vid_pid(bmda_cli_options_s *const cl_opts, const p bool ftdi_lookup_cable_by_product(bmda_cli_options_s *cl_opts, const char *product) { if (cl_opts->opt_cable) - return false; + return true; for (const cable_desc_s *cable = &cable_desc[0]; cable->vendor; ++cable) { if (cable->description && strstr(product, cable->description) != 0) {