X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhantek-6xxx%2Fapi.c;h=899dc86716bfc49c75b7a19f108b780c13c607d7;hb=3d70d77709b023499b09e7d0f0e3c20f3c58f140;hp=4e64808932e5af1d2e189ee14d1fa069cf58bf38;hpb=b3fd09937ce099d5a7086ff6bbdfa1b4f371cabd;p=libsigrok.git diff --git a/src/hardware/hantek-6xxx/api.c b/src/hardware/hantek-6xxx/api.c index 4e648089..899dc867 100644 --- a/src/hardware/hantek-6xxx/api.c +++ b/src/hardware/hantek-6xxx/api.c @@ -217,7 +217,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) libusb_get_device_descriptor(devlist[i], &des); - usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); + if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0) + continue; prof = NULL; for (j = 0; dev_profiles[j].orig_vid; j++) { @@ -460,6 +461,8 @@ static int config_list(uint32_t key, GVariant **data, *data = std_gvar_array_u32(ARRAY_AND_SIZE(devopts_cg)); break; case SR_CONF_COUPLING: + if (!devc) + return SR_ERR_ARG; *data = g_variant_new_strv(devc->coupling_vals, devc->coupling_tab_size); break; case SR_CONF_VDIV: