From e3804183f789220ffbb71d3c9012ef7172ad8114 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sun, 23 Jan 2022 12:26:57 +0100 Subject: [PATCH] bmp_libusb: Fix crash with FTDI devices as outdated variable was used. Triggered by 7b1eb6e6e3. --- src/platforms/hosted/bmp_libusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/hosted/bmp_libusb.c b/src/platforms/hosted/bmp_libusb.c index aff66f9..c6bcf2f 100644 --- a/src/platforms/hosted/bmp_libusb.c +++ b/src/platforms/hosted/bmp_libusb.c @@ -299,7 +299,7 @@ int find_debuggers(BMP_CL_OPTIONS_t *cl_opts,bmp_info_t *info) } if ((found_debuggers == 0) && ftdi_unknown) DEBUG_WARN("Generic FTDI MPSSE VID/PID found. Please specify exact type with \"-c \" !\n"); - if ((found_debuggers == 1) && !cl_opts->opt_cable && (type == BMP_TYPE_LIBFTDI)) + if ((found_debuggers == 1) && !cl_opts->opt_cable && (info->bmp_type == BMP_TYPE_LIBFTDI)) cl_opts->opt_cable = active_cable; if (!found_debuggers && cl_opts->opt_list_only) DEBUG_WARN("No usable debugger found\n");